Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Conversion failed when converting date and/or time

Author  Topic 

micnie_2020
Posting Yak Master

232 Posts

Posted - 2012-07-03 : 04:57:44
Hi,

create table test
(
fromdate DateTime null
)

insert into test (fromdate)values('11/3/2010 4:37:23 PM +08:00')

I got error:
Conversion failed when converting date and/or time from character string.

Please advise.

Thank you.

Regards,
Micheale

micnie_2020
Posting Yak Master

232 Posts

Posted - 2012-07-03 : 05:03:20
Thank you.

Solved it!

Replace
create table test
(
fromdate datetimeoffset null
)
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2012-07-03 : 07:13:23
Also add dates with unambigious date format
http://beyondrelational.com/modules/2/blogs/70/posts/10899/understanding-datetime-column-part-ii.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -