Hi Dear,
I am using Dateformat command, and other methods too to get the desired result, but could not get success.
Please help in getting the desired result.
I am having a date-time column in a table (time is in 24 hours), I want to fetch the records and display this field in format
"03/14/2012 01:00:00 PM" ie "MM/dd/yyyy HH:mm:ss AM/PM".
DECLARE @Date DATETIME
SET @Date = GETUTCDATE()
SELECT @Date, CONVERT(VARCHAR, @Date, 101), CONVERT(VARCHAR(26), CAST(@Date AS Time), 109)
The result for above query is :
02/05/2013 9:36:06.2630000AM
Expected result is :
02/05/2013 09:36:06 AM
Thanks and Regards,
Mayank Tripathi
Mo. +91 730 484 7179