Star79
asked on
Convert Datetime in SQL
How to convert the datetime 2013-01-03 00:00:00 to format 03-JAN-13 in sql 2005
Thanks All!
Thanks All!
try this select REPLACE(CONVERT(CHAR(11), GETDATE(), 106),' ','-')
ASKER
ERIK: The select REPLACE(CONVERT(CHAR(11), GETDATE(), 106),' ','-') is giving me year as yyyy,I only need yy
Any idea
Any idea
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
https://msdn.microsoft.com/en-us/library/ms187928.aspx
see also:
https://www.experts-exchange.com/articles/1499/DATE-and-TIME-don%27t-be-scared-and-do-it-right-the-first-time.html