프로그래밍/DataBase

[MSSQL] Adding string to DATEDIFF(day,getdate(),enddate) as DayRemain how please?

홍반장水_ 2022. 2. 21. 17:29
반응형

Adding string to DATEDIFF(day,getdate(),enddate) as DayRemain how please?

 

select 'Days remain ' + convert(varchar(20),(DATEDIFF(day,getdate(),'29 Oct 2011 12:00:00'))) as 'Days Remain'

the output of above query will be 

| Days Remain     |

| Days remain 30 |

반응형