Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Remove est from date value in ssis derived column

I have date in format of 22-Mar-2023 08.01.44 PM(EST)
I Want to remove (Est) part of the date but it fails
Trying this doesn’t work

SUBSTRING([Data Date],1,2) + "-" + (SUBSTRING( [Data Date],4,3) == "JAN" ? "01" :SUBSTRING( [Data Date],4,3) == "FEB" ? "02" : SUBSTRING( [Data Date],4,3) == "MAR" ? "03" :SUBSTRING( [Data Date],4,3) == "APR" ? "04" :SUBSTRING( [Data Date],4,3) == "MAY" ? "05" : SUBSTRING( [Data Date],4,3) == "JUN" ? "06" :SUBSTRING( [Data Date],4,3) == "JUL" ? "07" :SUBSTRING( [Data Date],4,3) == "AUG" ? "08" :SUBSTRING( [Data Date],4,3) == "SEP" ? "09" : SUBSTRING( [Data Date],4,3) == "OCT" ? "10" : SUBSTRING( [Data Date],4,3) == "NOV" ? "11" : SUBSTRING( [Data Date],4,3) == "DEC"? "12") + "-" + SUBSTRING([Data Date],8,4)
Looks like some syntax error
"Expression cannot be parsed"

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The REPLACE Expression shall work for you in SSIS Derived Column transformation

replace all occurrences using :

(DT_WSTR, 20)REPLACE([Data Date], "(EST)", "")

OR
The below one using LEFT Expression

LEFT([Data Date],LEN([Data Date])-5)

This will extract the left part of the Data Date column excluding the last 5 characters

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading