BLOG

Expression to account for weekends through SSIS

03-08-2019  0 Comment(s)

when outputting to excel. How can i get this to be just the date like 20150429 instead of the full start time.

((DT_I4)DATEPART("weekday",@[System::StartTime]) ==2 ? 

Replace((DT_STR, 20, 1252)(DATEADD( "D", -3,@[System::StartTime])),":","") + 
".xlsx" : 
Replace((DT_STR, 20, 1252)(DATEADD( "D", -1,@[System::StartTime])),":","") + 
".xlsx")

the code can be altered and remolded to this

[code]
LEFT(
REPLACE(
(DT_STR, 20, 1252)(DATEADD( "D", 
(DT_I1)DATEPART("weekday",@[System::StartTime]) ==2 ? -3 : -1, 
@[System::StartTime])),"-","")
,8) + ".xlsx"
[/code]

Comment Here

Comments

No Comments to Show

WE ALWAYS WORK WITH :