Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

SSIS Convert MMDDYY(char) column to DATE

$
0
0

I have a table of 120,000+ rows.  One of the column is dates in the MMDDYY format: 
092509
012009
091711

I've brought them in from Teradata, and stored in a staging table in char format.  I now need to change the values to SQL DATE format and move to my permanent table.

Based on other posts, I have tried the following expressions, but both give CAST errors:

(DT_DATE)("20"+(SUBSTRING((DT_WSTR,8)DCSD_BRWR_CD_DT,5,2) + "-" +SUBSTRING((DT_WSTR,6)DCSD_BRWR_CD_DT,1,2) + "-" +SUBSTRING((DT_WSTR,6)DCSD_BRWR_CD_DT,3,2)))

(DT_DATE)((SUBSTRING((DT_WSTR,6)DCSD_BRWR_CD_DT,1,2) + "-" +SUBSTRING((DT_WSTR,6)DCSD_BRWR_CD_DT,3,2) + "-20" +SUBSTRING((DT_WSTR,6)DCSD_BRWR_CD_DT,5,2)))
Thanks

-Al H



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>