sql - SSIS Date Function -
i stuck on on date part in ssis package
i created 3 variabels in package & used these expression
1) @days - 8 2) @datediff - (dt_wstr,4)year(getdate()) + "-" + right("0" + (dt_wstr,2)month(getdate()), 2)+ "-"+ right("0" + (dt_wstr,2)day(dateadd("dd", - @[user::days] , getdate())), 2) 3) @datestarted - datediff("dd", (dt_dbtimestamp) @[user::diffdate],(dt_dbtimestamp) @[user::patdate] )
here patcon same getdate().
here if changed day upto 30 not take me tht 2013-06-17 show me same date 2013-07-17 (suppose gatedate() 2013-07-17).
i want expression dynamically change date suppose if placed days - 50 should change month also. , if days - 500 change month year.
please let me know further detail.appreciated time , help.i wnat develope in package side not t-sql side.
--343
you're applying dateadd
portion day substring taken, need apply month , year if want them affected. believe it:
(dt_wstr,4)year(dateadd("dd", - @[user::days] , getdate())) + "-" + right("0" + (dt_wstr,2)month(dateadd("dd", - @[user::days] , getdate())), 2) + "-" + right("0" + (dt_wstr,2)day(dateadd("dd", - @[user::days] , getdate())), 2)
Comments
Post a Comment