Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

datetime format Expand / Collapse
Author
Message
Posted Tuesday, December 30, 2008 9:30 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, February 11, 2011 7:01 AM
Points: 91, Visits: 198

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?
Post #627436
Posted Tuesday, December 30, 2008 9:33 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Thursday, June 5, 2014 10:54 AM
Points: 9,294, Visits: 9,480
select CONVERT(varchar(10),getdate(),121)



-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #627438
Posted Tuesday, December 30, 2008 9:55 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, September 15, 2014 2:38 AM
Points: 2,223, Visits: 3,647
Also refer to CONVERT Function in your Books Online for various conversion options available.






Pradeep Singh
Post #627450
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse