469,898 Members | 1,581 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

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 1554
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
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.