nabajyoti.b
SSCrazy
Points: 2177
More actions
December 30, 2008 at 9:30 am
#128868
i put to put the value of a datetime variable to a string variable in the format yyyy-mm-dd.
How do i do that?
RBarryYoung
SSC Guru
Points: 143329
December 30, 2008 at 9:33 am
#919114
select CONVERT(varchar(10),getdate(),121)
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
ps.
One Orange Chip
Points: 29422
December 30, 2008 at 9:55 am
#919126
Also refer to CONVERT Function in your Books Online for various conversion options available.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply