Apply date functions to data source columns
Hi guys, I am a complete newbie with SSIS and am trying to get my head around modifying data that I get from a data source before I send it off to the destination. What I want to do, if possible, is to take the date that comes from my source and calculate the last day of the month. That day should go into my destination. So for example if the date in my source is 15 July 2011 I want to put 31 July 2011 into the destination. How would I go about doing that? Just to give you some background on the setup I have: At the moment I have in my Data Flow diagram a SharePoint Source and a SharePoint Destination, which I have added with the help of the SSIS Adapter for SharePoint. This allows me to easily move data from one list into another. I just need a different date to what is there at the moment. Thanks for the help.
March 28th, 2011 7:51am

Try the following expression in the derived column component: (DT_DBDATE)DATEADD("d",-DAY(GETDATE()),DATEADD("m",1,GETDATE())) This is how it works: you add a month by the current date. Then you substract all the days from that date. For example, if today is the 28th, we substract 28 days from that date, which gives us the last day of the previous month. The DT_DBDATE cast is used to drop the time portion.
Free Windows Admin Tool Kit Click here and download it now
March 28th, 2011 8:47am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics