Wednesday, June 20, 2012

To select time format in hh:mm (AM/PM) format


SELECT REPLACE(REPLACE(RIGHT('0'+LTRIM(RIGHT(CONVERT(varchar,getdate(),100),8)),7),'PM',' PM'),'AM',' AM')

No comments:

Post a Comment