472,127 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

conversion from varchar

I have a column named entrydate in my table as datatype varchar as following
mm/dd/yyyy . How can I convert the column to datetime format..

I tried the following but i got an error


select convert(datetime,entrydate,1) from timeentry


I got the following error

::Conversion failed when converting datetime from character string.
Feb 24 '09 #1
1 1595
Try CAST instead of CONVERT


SELECT CAST(entrydate AS datetime) FROM timeentry
Feb 24 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Ivan | last post: by
1 post views Thread by Vladimir Khvostov | last post: by
reply views Thread by =?Utf-8?B?RGVuaXMgU29oZXQ=?= | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.