File System Object Task - Variable File Name

  • Sorry, that's what I want, I'm getting 2006327.txt

  • OK, that's easily fixed:

     

    "C:\\Local\\DataIn\\SEG_IDEM_"  + (DT_WSTR,4)DatePart("yyyy", GetDate()) + RIGHT("0" + (DT_WSTR,2)DatePart("mm", GetDate()), 2) + RIGHT("0" + (DT_WSTR,2)DatePart("dd", GetDate()), 2) + ".txt"

     

    -Jamie

     

  • When in doubt, check BOL (still having trouble with the search).  It works with:

    "C:\\Local\\DataIn\\SEG_IDEM_"  +  (DT_WSTR,4)DatePart("yyyy", GetDate()) <"10" ?

    (DT_WSTR,4)DatePart("yyyy", GetDate()) : (DT_WSTR,4)DatePart("yyyy", GetDate()) +"0" +

    (DT_WSTR,2)DatePart("mm", GetDate()) +  "0" +

    (DT_WSTR,2)DatePart("dd", GetDate()) + ".txt"

    will do the same for the DD...

    Thanks, mary

  • I cross-posted, thanks again, Jamie.

Viewing 4 posts - 16 through 18 (of 18 total)

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