Link to home
Start Free TrialLog in
Avatar of Star79
Star79Flag for United States of America

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!
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

try this select REPLACE(CONVERT(CHAR(11), GETDATE(), 106),' ','-')
Avatar of Star79

ASKER

ERIK: The select REPLACE(CONVERT(CHAR(11), GETDATE(), 106),' ','-') is giving me year as yyyy,I only need yy
Any idea
ASKER CERTIFIED SOLUTION
Avatar of erikTsomik
erikTsomik
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial