Click here to Skip to main content
15,886,634 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Developers, I am working on SSIS in my XML file I have reading dates like 2013-08-02, 2013-08-4, 2013-08-05 but I have to change the data date to from last two days, What I mean is that the data date stamp should be changed to 2017-05-21,2017-05-22,2017-05-22.

What I have tried:

what I was done is added a derived column in the SSIS package and changed the expression with GETDATE() in this case I am getting only today date, But I need to change data from last two days. Can anyone help me?
Posted
Comments
Maciej Los 24-May-17 2:42am    
Sorry, but you question is unclear. 22 may 2017 is counted twice. Can you explain why? Can you share your sample data?
Akhil Madivada 24-May-17 11:04am    
Thank you for your reply, Here is my sample XML file data with timestamp,
<Reading TimeStamp="2013-08-02 03:45:00" RawReading="229.9"/>
<Reading TimeStamp="2013-08-03 00:00:00" RawReading="0"/>
<Reading TimeStamp="2013-08-04 18:30:00" RawReading="0"/>
<Reading TimeStamp="2013-08-07 20:15:00" RawReading="0"/>

I have to change the timestamp date from 2013-08-02 to 2017-05-21, 2013-08-03 to 2017-05-22, 2013-08-04 to 2017-05-23 and 2013-08-07 to 2017-05-24. this changes I have to do by using SSIS and my destination is OLEDB.
Maciej Los 24-May-17 11:19am    
And what have you done till now?
Akhil Madivada 24-May-17 11:31am    
created SSIS packages in data flow connecting XML source and the OLEDB destination and in the middle of this two transformations I placed a derived column transformation and added an expression GETDATE() in this case the dates in the data are changing to today's date but I but to change in a sequence from last days.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900