Thursday 29 December 2011

How to Get the Time in AM PM Format Just Copy and Paste Given Below Query


select substring(convert(varchar(20), GetDate(), 9), 13, 5)
+ ' ' + substring(convert(varchar(30), GetDate(), 9), 25, 2)

And how can it Concat with Time see the Given below examle:- 

select CONVERT(VARCHAR(10), GETDATE(), 103)+
substring(convert(varchar(20), GetDate(), 9), 13, 5)
+ ' ' + substring(convert(varchar(30), GetDate(), 9), 25, 2)



No comments:

Post a Comment