Probably am going crazy, but I am trying to assign a field to NULL
in a case statement, however, I get an error on the equals next to the NULL
keyword
Here is the SQL:
SELECT CASE WHEN enq.IntField = 0 THEN enq.IntField = NULL ELSE enq.IntField END As IntField
FROM [Table]
Surely I am doing something stupid!!
Thanks in advance
Try this
CASE WHEN enq.IntField = 0 THEN NULL ELSE enq.IntField END