May 30, 2010 at 12:23 am
using this: http://www.tek-tips.com/faqs.cfm?fid=4191
executing this sql on that procedure select dbo.fn_formatdatetime (getdate() ,'h:nnAM/PM');
always returns the 24 hour time format , I want it to return the 12 hour time format.
Or you can give me another sql to do that
May 30, 2010 at 2:23 am
How about using CONVERT?
SELECT RIGHT(CONVERT(CHAR(19),GETDATE(),100),7)
May 30, 2010 at 12:36 pm
man9500 (5/30/2010)
using this: http://www.tek-tips.com/faqs.cfm?fid=4191executing this sql on that procedure
select dbo.fn_formatdatetime (getdate() ,'h:nnAM/PM');
always returns the 24 hour time format , I want it to return the 12 hour time format.
Or you can give me another sql to do that
Unless there just isn't one, this type of formatting should be done only in the GUI. Certainly, you should never save formatted date info in a table.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply