1

I'm trying to execute a query against an ODBC source using an Execute SQL Task. This is my statement:

"select * from RoomType where zz__Timestamp_Modification_UTC__lcm >=  TIMESTAMP '" +@[User::LastJobRunDateTimeUtc]+ "'"

in expression builder when I press "Evaluate Expression" button I get this error:

error message

I've tried various escape characters but nothing is working. I found a post or two on this like this one. From what I can see I'm doing the same thing. How to pass SSIS variables in ODBC SQLCommand expression?

Hadi
  • 36,233
  • 13
  • 65
  • 124
SmokerJones
  • 323
  • 1
  • 2
  • 11

1 Answers1

1

My variable @[User::LastJobRunDateTimeUtc] was of type DateTime and apparently expression builder does not like that when using + to combine strings with variables other than string so I cast @[User::LastJobRunDateTimeUtc] to a string and it worked.

(DT_WSTR,50)@[User::LastJobRunDateTimeUtc]
Hadi
  • 36,233
  • 13
  • 65
  • 124
SmokerJones
  • 323
  • 1
  • 2
  • 11