sql server - How do I remove seconds from date time in SQL query -
this question has answer here:
there several ex same type think bit unique.
my query is:
select convert(nvarchar(15),date,103)+ ' ' + ltrim(right(convert(char(20),date, 22), 11))dc table1
result is:
i getting right in above result. thing need require format should 09/11/2015 2:29 pm
.
there many format achieve user unlike change other format. thank in advance
try this:
select convert(nvarchar, date, 101) + ' ' + left(right(convert(nvarchar, date, 100), 7),5) + ' ' +right(convert(nvarchar, date, 100), 2)
Comments
Post a Comment