0

my date format is in this format YYYYMMDD and when I am converting the same with data conversion task I am getting below error:

The data value cannot be converted for reasons other than sign mismatch or Data Overflow.

In my Dataconversion I have select DT_DATE and in database the column datatype is date.

But the strange thing is that when I am executing my package and doing casting as source SELECT CAST(myDate AS DATE) package is working fine.

Zerotoinfinity
  • 6,290
  • 32
  • 130
  • 206

1 Answers1

2

It's a common issue. If you use a derived column transformation, you will need to slice it out into the component parts (years, months, days) and then concatenate it back together before casting. That's ugly and time consuming for me.

Instead, assuming this is coming from a flat file, just make it a date on import by setting the type in your connection manager to the date type that will be compatible with your destination. Then on your flat file source, under advanced settings, set FastParse to true for that column. See my answer on Import String Date in Derived column for a pictoral walkthrough of it. Also addressed it on SSIS importing datetime column into SQL Server 2008

Community
  • 1
  • 1
billinkc
  • 59,250
  • 9
  • 102
  • 159