Last post Sep 09, 2018 06:30 PM by PatriceSc
Sep 09, 2018 08:34 AM|Bonerparte|LINK
I have a further question which I doubt you will have any problem answering...
I am converting a date in a query and it works brilliantly, but how do I show a blank field if there is no value to return?
The query line I am using at the moment is:
Select CONVERT (VARCHAR(10), a.siteeol, 103) as [Site End Of Life Date]
and the line I would normally use to show a blank field is:
ISNULL (a,siteeol, '') as [Site End Of Life Date]
is it possible to merge the two somehow?
Thanks and best wishes
Sep 09, 2018 03:06 PM|A2H|LINK
You can try with below code
Select ISNULL(CONVERT (VARCHAR(10), a.siteeol, 103),'') as [Site End Of Life Date]
Sep 09, 2018 06:30 PM|PatriceSc|LINK
Answered but it is often suggested to convert as late as possible (ie when you are about to show this value to a user). For example here if you ever need to test this value for some reason you would have to convert it back to a DateTime). Same if you want
to support multiple languages...