I have a transformation script I am running in C# within SSIS. I am simply attempting to take a date attribute from my source file and add a single day to that date. Do I really need to create a variable to facilitate this?
Asked
Active
Viewed 376 times
-1
-
Hi, Welcome to SO, can you please include the code you've already tried and this would also provide better context for your question. – FishStix Aug 30 '16 at 01:02
-
It is up to you how to code ie attribute date can be incremented date++ or x= var+1 and use .. – sandeep rawat Aug 30 '16 at 05:30
1 Answers
1
If you wish to perform the task of adding a day to a date attribute in C# script, then take a look at the following link:
Otherwise, an expression like the following applied in a derived column under data flow will also work.
DATEADD("day", 1, DateAttribute) //Apply if Attribute already is in datetime type.
DATEADD("day", 1, (DT_DBTIMESTAMP)DateAttribute) //Apply if Attribute needs to be converted to datetime type in order to then add a day.
Whether or not you need to add a variable is something I cannot answer. More information on how this attribute is applied downstream in the pipeline is required. Using variables is generally a good practice in SSIS packages. Take a look at the following very helpful link for best practices.
Hope this helps.

Community
- 1
- 1

user3662215
- 526
- 4
- 12