Showing posts with label systemstarttime. Show all posts
Showing posts with label systemstarttime. Show all posts

Friday, February 10, 2012

Cast @[System::StartTime] Problem

This is a Subject Expression I put in my Mail component in my SSIS 2005 package but it's not liking the StartTime concatenation. I tried other ways but can't get it to allow this:

"Process Started by : " + @.[System::UserName] + (DT_DATE) @.[System::StartTime]

I get the error:

TITLE: Expression Builder

Expression cannot be evaluated.


ADDITIONAL INFORMATION:

The data types "DT_WSTR" and "DT_DATE" are incompatible for binary operator "+". The operand types could not be implicitly cast into compatible types for the operation. To perform this operation, one or both operands need to be explicitly cast with a cast operator.

Attempt to set the result type of binary operation ""Process Started by : " + @.[System::UserName] + (DT_DATE)@.[System::StartTime]" failed with error code 0xC0047080.

I tried to use CAST() but not sure if that's allowed or the syntax for it specifically in SSIS 2005

As the error message says, you cannot concatenate DT_WSTR & DT_DATE. Try:

"Process Started by : " + @.[System::UserName] + (DT_WSTR) @.[System::StartTime]

-Jamie