Update query

E

Eddy

Hi,

I'm having some problem using an update query.

What the problem is: Appending two fields with one empty result in an empty
string.
Using the CONCAT_NULL_YIELDS_NULL doesn't seem to work. I've used the
"alter database <dbname> CONCAT_NULL_YIELDS_NULL off" command but this
didn't work.

Any help would be appreciated.

Thx.
 
M

Microsoft News Groups

You could try using the CASE statement. Check my syntax though. '' is two
' not " of course.

CASE WHEN Field1 IS NULL THEN '' ELSE Field1 END + CASE WHEN Field2 IS NULL
THEN '' ELSE Field2 END

Rod Scoullar
 
S

Sylvain Lafontaine

You can also use the IsNull function to replace any null with an empty
string:

select isNull (Field1, '') + isNull (Field2, '') as Result From ...

S. L.
 
Å

åÌÅÎÁ

Microsoft News Groups said:
You could try using the CASE statement. Check my syntax though. '' is two
' not " of course.

CASE WHEN Field1 IS NULL THEN '' ELSE Field1 END + CASE WHEN Field2 IS NULL
THEN '' ELSE Field2 END

Rod Scoullar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top