Display Datetime Field as blank if isnull?

  • Hello,

    Please can someone advise me how I can set a datetime field to blank if the field evaluates to be null?

    Thanks.

     

  • The datetime specification requires either a date or a null value. There aren't any "blank" dates. If you're using it for display purposes, you can convert to a character datatype which does support empty strings and do something like:

    SELECT ISNULL(CONVERT(VARCHAR, my_date), '') AS my_date

  • Yes, it is for display purposes. Thanks for your help.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply