SSIS Package conditional splitting


hello,

i need splitting records based on account open date. have set of data has accounts opening dates past 3 months(dec, jan, & feb). want group them month yet last business day of each month needs included following month(ex:jan 29th february). trying think through how , quite challenge. want group data set months , select max open date last business day of month , possibly split way?

i trying use conditional split in package yet condition section puzzling me(due using last business day)

any suggestions help!

thank you!!!

hi johnny,

how define last business days? if working days, follow below sample. if business days excluding holidays , other days weekends, things complicated, please provide more details.


the expressions each variable

lastdayofpastfirstmonth ====================================================================================================================== dateadd("dd",-1,dateadd("mm",datediff("mm",(dt_dbtimestamp)"01/01/2000",getdate()),(dt_dbtimestamp)"01/01/2000")) ======================================================================================================================  lastdayofpastsecondmonth ====================================================================================================================== dateadd("dd",-1,dateadd("mm",datediff("mm",(dt_dbtimestamp)"01/01/2000",getdate())-1,(dt_dbtimestamp)"01/01/2000")) ======================================================================================================================  lastdayofpastthirdmonth ====================================================================================================================== dateadd("dd",-1,dateadd("mm",datediff("mm",(dt_dbtimestamp)"01/01/2000",getdate())-2,(dt_dbtimestamp)"01/01/2000")) ======================================================================================================================   lastworkingdayofpastfirstmonth ====================================================================================================================== (datepart("weekday",@[user::lastdayofpastfirstmonth])==7 || datepart("weekday",@[user::lastdayofpastfirstmonth])==1)? ( 	(datepart("weekday",dateadd("dd",-1,@[user::lastdayofpastfirstmonth]))==7 	|| 	datepart("weekday",dateadd("dd",-1,@[user::lastdayofpastfirstmonth]))==1)? 	(dateadd("dd",-2,@[user::lastdayofpastfirstmonth])) 	: 	(dateadd("dd",-1,@[user::lastdayofpastfirstmonth])) ) : @[user::lastdayofpastfirstmonth] ======================================================================================================================   lastworkingdayofpastsecondmonth ======================================================================================================================  (datepart("weekday",@[user::lastdayofpastsecondmonth])==7 || datepart("weekday",@[user::lastdayofpastsecondmonth])==1)? ( 	(datepart("weekday",dateadd("dd",-1,@[user::lastdayofpastsecondmonth]))==7 	|| 	datepart("weekday",dateadd("dd",-1,@[user::lastdayofpastsecondmonth]))==1)? 	(dateadd("dd",-2,@[user::lastdayofpastsecondmonth])) 	: 	(dateadd("dd",-1,@[user::lastdayofpastsecondmonth])) ) : @[user::lastdayofpastsecondmonth] ======================================================================================================================   lastworkingdayofpastthirdmonth ====================================================================================================================== (datepart("weekday",@[user::lastdayofpastthirdmonth])==7 || datepart("weekday",@[user::lastdayofpastthirdmonth])==1)? ( 	(datepart("weekday",dateadd("dd",-1,@[user::lastdayofpastthirdmonth]))==7 	|| 	datepart("weekday",dateadd("dd",-1,@[user::lastdayofpastthirdmonth]))==1)? 	(dateadd("dd",-2,@[user::lastdayofpastthirdmonth])) 	: 	(dateadd("dd",-1,@[user::lastdayofpastthirdmonth])) ) : @[user::lastdayofpastthirdmonth] ======================================================================================================================

if have question, feel free let me know.


eric zhang
technet community support



SQL Server  >  SQL Server Integration Services



Comments

Popular posts from this blog

more indexes

ActiveDirectory

Virtual Channel