Home Forums SQL Server 2008 T-SQL (SS2K8) How do I remove nulls from case statements with date fields? RE: How do I remove nulls from case statements with date fields?

  • Gazareth (8/6/2012)


    MS SQL implicitly casts a blank string into 1900-01-01 00:00:00 in datetime data type so you're a bit stuck there.

    Not sure why the NULLs are a problem though in your calculation?

    Expanding on this a little, you are asking SQL Server to return either a date, or a string, in the same column. It can't do that. So it does the conversion Gazereth mentioned.

    If you were to convert the date you select to a string, you might get what you want. I say 'might', because I don't 100% understand all of your post.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.