Click here to Skip to main content
15,922,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

need the below the date format in sql

MM/DD/YYYY HH:MI:SS:MMMAM format in sql server

Please help me.

Thanks in Advance.
Posted

Use CONVERT with format 9 or 109: http://www.w3schools.com/sql/func_convert.asp[^]
 
Share this answer
 
To be precise use this.

SQL
SELECT CONVERT(CHAR(11), GETDATE(), 101) + LTRIM(RIGHT(CONVERT(CHAR(26), GETDATE(), 9), 14));
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900