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
 SSIS and Import/Export (2008)
 SSIS date import

Author  Topic 

colmanmadden
Starting Member

1 Post

Posted - 2011-11-17 : 18:12:18
I'm importing a date from a text file using SSIS. The date is in the format 22.07.2010 00:00:00. I'm doing a replace on the '.' with '-' and then doing a conversion to database date(DT_DBDATE).

Works fine for 22nd september but for some like 10th march it will change it to 3rd of October. See results below:

22-07-2010 00:00:00 TO 2010-07-22 00:00:00.000
10-03-2009 00:00:00 TO 2009-10-03 00:00:00.000

Any ideas how to fix this?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-11-18 : 02:16:56
thats because of date format. either set dateformat to dmy or pass dates in iso format 2009-03-10

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-11-21 : 03:38:44
Make sure to read this post
http://beyondrelational.com/blogs/madhivanan/archive/2010/06/03/understanding-datetime-column-part-ii.aspx

Madhivanan

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

- Advertisement -