0

I am dynamically generating the date for ssis tranformation using variable expression. My below expression generates the output like:

02102014.csv
Expression :
+RIGHT("0" + (DT_WSTR, 2)  MONTH(dateadd("d", -1, getdate())), 2) 
+RIGHT("0" + (DT_WSTR, 2) DAY(dateadd("d", -1, getdate())), 2)
+(DT_WSTR, 4)  YEAR(dateadd("d", -1, getdate()))+ ".csv"

How can I get the value like 021014.csv. In the year string it should pick up only last two values. Can anyone help me?

Eduardo
  • 4,282
  • 2
  • 49
  • 63
user3203331
  • 429
  • 2
  • 7
  • 23

2 Answers2

1

Expression:

RIGHT("0" + (DT_WSTR, 2) MONTH(dateadd("d", -1, getdate())), 2) 
+ RIGHT("0" + (DT_WSTR, 2) DAY(dateadd("d", -1, getdate())), 2)
+ RIGHT((DT_WSTR, 4) YEAR(dateadd("d", -1, getdate())), 2)+ ".csv"

Result:

021014.csv
Bryan
  • 17,112
  • 7
  • 57
  • 80
0
RIGHT("0" + (DT_WSTR, 2)  MONTH(dateadd("d", -1, getdate())), 2) 
+RIGHT("0" + (DT_WSTR, 2) DAY(dateadd("d", -3, getdate())), 2)
+RIGHT("1"+(DT_WSTR, 4)  YEAR(dateadd("d", -1, getdate())),2)+ ".csv"
user3203331
  • 429
  • 2
  • 7
  • 23