Hi all,

I am attempting to rename a file using the File System Task Editor in SSIS. In the Expression Builder, I have

@[User::fileName]+(DT_WSTR,2)DATEPART("mm",GETDATE())+(DT_WSTR,4)DATEPART("yyyy",GETDATE())+".zip"

but it returns the following error:

TITLE: Expression Builder
Expression cannot be evaluated.

ADDITIONAL INFORMATION:

The data types "DT_I4" and "DT_WSTR" 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 "@[User::fileName] + (DT_WSTR,2)DATEPART("mm",GETDATE())" failed with error code 0xC0047080.

Can someone please tell me what I am doing wrong?

I took a completely different approach to this and am using Package Variables within the File System Task Editor.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.