Evaluate as expression syntax

  • Hi all,

    I'm using a variable in my package with the evaluate as expression set to true. The expression i'm trying to run is:

    "Enc_Unison_" + REPLACE(CONVERT(char(8), getdate(), 10), "-", "") + ".txt"

    I'm expecting the results:

    "Enc_Unison_101008.txt"

    Seems simple but I can't for the life of me get it to work. Can anyone see what I'm doing wrong in my syntax?

  • Try

    "Enc_Unison_" + RIGHT("00" + (DT_WSTR, 10) DATEPART( "mm", GETDATE()) ,2) + RIGHT("00" + (DT_WSTR, 10) DATEPART( "dd", GETDATE()) ,2) + (DT_WSTR, 10) DATEPART( "yyyy", GETDATE()) + ".txt"

    HTH

  • Great thanks!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply