Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to convert date to yyyy-mm-dd for XML

Status
Not open for further replies.

jahooper

Programmer
Jan 20, 2003
8
0
0
US
I need to convert some dates to yyyy-mm-dd format for XML. I know the following:

convert(varchar,GetDate(),126) --> 2004-06-02T16:13:49.293

My question is, how do I get just the yyyy-mm-dd component without the time?

Thanks for any suggestions!
 
SELECT CONVERT(VARCHAR(10),GETDATE(),120) is what you need. Good luck.
 
Thanks for the quick tip. That did it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top