Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to convert a string to date ?
Message
From
19/04/2001 08:35:51
 
 
To
18/04/2001 15:32:48
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00496935
Message ID:
00497203
Views:
12
As Sylvain mentioned you could use the CONVERT() or CAST() funciton. SQL Server is also capable of implicitly converting a string to a datetime datatype.

You should also checkout the SET DATEFORMAT connection setting. It could affect the converstion. For the best results, format the string as YYYYMMDD. SQL Server will always recognize this format and convert it properly.

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform