Home > DeveloperSection > Forums > Convert VarChar to DataTime
sandy taylor
sandy taylor

Total Post:46

Points:324
Posted on    October-09-2010 4:14 AM

 MSSQL Server MSSQL Server 
Ratings:


 1 Reply(s)
 1123  View(s)
Rate this:
I have a filed with VarChar in my table , I want to convert it in DateTime..

thanks


Uttam Misra

Total Post:125

Points:897
Posted on    October-09-2010 4:24 AM

try this..
SELECT convert(datetime, '1/12/2010', 212) -- mm/dd/yyyy

SELECT convert(datetime, '2010.1.12', 214) -- yyyy.mm.dd


cheers! 

Modified On Oct-09-2010 04:24:40 AM

Don't want to miss updates? Please click the below button!

Follow MindStick