Basically the variables were created this way:
- Gave a descriptive name (need to have those so you know what to look for later!)
- Scope, was selected to be the Task being worked on, which was easy since the project only had one task for data loading.
- Data Type, since it was for Dates I made this DateTime
- Value, just hit enter/return here and it took the current date and time
- Expression, this is the real work here
- For Now this was just left as the default - GetDate()
- For a Year I made an expression - DATEADD("Year",1,(GetDate()))
- Same adjustments for Adding Minute or Month, just adjust Year
When using these, in the Derived Columns select the Expression column and in the upper right panel there is a tree for Variables and Parameters. Select the User: and this will update the value for that column when the Derived Columns task runs.
Learning about DateAdd came from the Microsoft Site
No comments:
Post a Comment