Q:

T-sql: Case show date or convert date to nvarchar

I want to use a case statement where my logic determines a date. If the value returned is a null value I instead want to display 'none' instead of a null value.
See code below.
CASE WHEN DATEDIFF(d, vso.pod_ata, ISNULL(cncr.cntr_date3, GETUTCDATE())) - 14 > 0 THEN vso.pod_ata + 14
ELSE CONVERT(NVARCHAR(10), 'none')
END AS 'start_dem',

SQL SERVER was complaining about conversion so I tried converting it to nvarchar but thats not working. Does anyone know a good solution for this?

A:

You should convert the date, not the string.
CASE WHEN DATEDIFF(d, vso.pod_ata, ISNULL(cncr.cntr_date3, GETUTCDATE())) > 14 THEN convert(VARCHAR(10), dateadd(day, 14, vso.pod_ata), 120)  
ELSE 'none'
END AS 'start_dem',

A:

SQL, to my knowledge, does not allow mixed datatypes in the same column. Convert the vso.pod_ata + 14 to an NVARCHAR as well.
CASE WHEN DATEDIFF(d, vso.pod_ata, ISNULL(cncr.cntr_date3, GETUTCDATE())) - 14 > 0 THEN CONVERT(NVARCHAR(50), vso.pod_ata + 14)
ELSE CONVERT(NVARCHAR(50), 'none')
END AS 'start_dem',

