Update query

  • Thread starter Thread starter Eddy
  • Start date Start date
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.
 
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
 
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
 
Back
Top