Change date in ssis package for XML file

I am working on SSIS on my XML file. I have show dates like 2013-08-02, 2013-08-4, 2013-08-05, but I need to change the data date to last two days, which means the data date stamp should be changed to 2017 -05-21,2017-05-22,2017-05-22. what i did was added derived column in SSIS package and changed expression using GETDATE (), in this case i only get today's date but i need to change last two days data. Can anyone help me?

+3


source to share


1 answer


Use the DATEADD function to add or subtract times from a date. In your derived column, use this in the Expression field:

DATEADD("d", -2, GETDATE())

      



Note that this also subtracts the time value, so if you need to convert to strictly date format (or timezone conversions), you need some extra code.

0


source







All Articles