SQL Server: Using a case statement to see if a date is NULL and if it is returning ' ' -


My selection statement has a column that looks like this:

  When fu CentAdtadt is tap "ELSE FU This return  19 00-01-01 00: 00: 00.000  which will otherwise be NULL 

I know this because When I just put it in fu.SentOutDate then it comes in the form of NULL

How can I get back the value? This is your "DATETIME," because the second column you return to is a date-time column.

Select

  when 1 = 1 then '' gateet (END)  

will give you the same value ...

You can convert it into varchar (32), but I do not have any effect

  when select 1 = 1 THEN '' ELSE CAST (GETDATE ()) as varchar ( 32)) END  

Comments