question

michael971 avatar image
michael971 asked

Integration date expression

I have a text file with a field DT_DBTIMESTAMP. I want to filter on it in the Conditional split but the expression DateValue > '10-01-2008' gives an error. What is the correct syntax?
ssis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Whitfield avatar image
Matt Whitfield answered
Try DateValue > '20080110' (assuming 01 is the month and 10 the day). That's the ISO representation, which works irrespective of user locale in TSQL generally. If not, then you'll have to hope someone with better SSIS experience answers.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Daniel Ross avatar image
Daniel Ross answered
When I ever need to do date expressions I always create a variable to hold the value, cause working with dates in SSIS expressions can be a major pain. Create a package scope variable called dateCompare with dataType Date and set the date you need, then in the expression type the expression below. date_change is from the data source date_change > @[User::dateCompare] Creating a variable is easier, cause you can then easily change the value, or you can change the variable value at runtime. If you want to put the value in the expression use it like this, you have to cast the string to a date format date_change > (DT_DATE)"2010-05-30"
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Whitfield avatar image Matt Whitfield ♦♦ commented ·
See - I told you you'd want to hope someone with better SSIS experience answers! :)
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.