Problem :
i need to get time for message if it sent today else i need to get the date of message with out time.
query :
select case when cast([CreateDate] as date) = cast(GETDATE() as date)
then CONVERT(varchar(15),CAST([CreateDate] AS TIME),100)
else CONVERT(varchar(15),CAST([CreateDate] AS date),100)
end
from [MOAKPIS].[dbo].[Notifications];
i need to get time for message if it sent today else i need to get the date of message with out time.
query :
select case when cast([CreateDate] as date) = cast(GETDATE() as date)
then CONVERT(varchar(15),CAST([CreateDate] AS TIME),100)
else CONVERT(varchar(15),CAST([CreateDate] AS date),100)
end
from [MOAKPIS].[dbo].[Notifications];
output
No comments:
Post a Comment