select (time-getdate()) from Tbl_time;
i want result "0 Days 1:22:56" instead of 1/1/1900 1:22:56 AM
SELECT convert(varchar,convert(int,datepart(dd,(getdate()-[time])))-1)+' Days ' + CONVERT(VARCHAR,getdate()-[time],108) FROM [Temporary].[dbo].[sample]
select (CONVERT(varchar, DATEDIFF(DAY, time, GETDATE())) + ' Days') AS NumberOfDays from Tbl_time
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)