CONVERT VARCHAR TO DATATIME

sandy taylor

Total Post:46

Points:324
Posted by  sandy taylor
 1353  View(s)
Ratings:
Rate this:
I have a filed with VarChar in my table , I want to convert it in DateTime..

thanks
  1. Uttam Misra

    Post:125

    Points:897
    Re: Convert VarChar to DataTime

    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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!