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

How to convert string in format dd.mm.yyyy to date using SSIS expression?

$
0
0

I have a date 26.12.2019(dd.mm.yyyy) in CSV which I'm trying to convert to 2019-12-26 using Derived Column in SSIS.

I have used this expression but it does not seem to work.

(TRIM([Period Start Date]) == "") ? NULL(DT_DATE) : (DT_DATE)(SUBSTRING([Period Start Date],7,4) + "-" + SUBSTRING([Period Start Date],4,2) + "-" + SUBSTRING([Period Start Date],1,2)) 
```
How do I rewrite this expression to produce the correct output with a value of data type?


Prajakt.


Viewing all articles
Browse latest Browse all 24688

Trending Articles



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