Snippet from a SQL query (using SQL Server 2008 R2):
, CONVERT (VARCHAR(10), s.ENTER_DATE, 101) "Enrollment Start Date"
, CONVERT (VARCHAR(10), (ISNULL(CAST(s.LEAVE_DATE AS VARCHAR(10)), '')) ,101) "Enrollment Drop Date"
The top line works fine to output the date to proper 101 format (eg: 06/22/2012
).
The bottom line works as desired to remove any NULL values to a blank, but... for any date values it does not output that date to proper 101 format, instead outputting the date in the default format (eg: Jun 22 2012).
I've played with the code and searched online but I cannot get the desired result.
Can anyone suggest a solution?
Thank you!