JonJon
Say Hey Kid
Points: 676
More actions
July 3, 2009 at 12:19 pm
#72849
I would like to convert/cast GETDATE() into a string but keep the format YYYY-MM-DD.
If I use a CAST(getdate() as varchar(50) I get July 3 2009
Need Assistance PLease.
Lynn Pettis
SSC Guru
Points: 442467
July 3, 2009 at 12:35 pm
#1019847
What you really need to do is lookup CONVERT in BOL (Books Online, the SQL Server Help System that you can access from SSMS by pressing the {f1} function key).
Here is what you are looking for:
select convert(char(10), getdate(), 120)
July 3, 2009 at 12:38 pm
#1019848
thank you
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply