Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6878857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:46:31+00:00 2026-05-27T04:46:31+00:00

This below evaluation will give me a date set to the format yyyymmdd as

  • 0

This below evaluation will give me a date set to the format yyyymmdd as an int.

What I need to do it have the ability in SSIS to offset the day by X days and keep the month and year offset accordingly.

I cant seem to find the answer. Everyone has an example on how to format it liek below, but what if you need to format it with an offset in days, months or years and at the same time keep all parts accurate.

RIGHT((DT_STR,4,1252)YEAR(DATEADD("dd",0,getdate())),4) +""+
RIGHT("0"  +(DT_STR,4,1252)MONTH(DATEADD("dd",-1,getdate())),2)+""+
RIGHT("0" +(DT_STR,4,1252)DAY(DATEADD("dd",0,getdate())) ,2)

Anyone?

In C# or TSQL this is easy, but this SSIS is growing my patience thin.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:46:32+00:00Added an answer on May 27, 2026 at 4:46 am

    Here is a possible solution that will allow you to achieve this.

    In the SSIS package, declare four package scope variables.

    1. TodaysDate – Variable of type DateTime. When you set to DateTime, the variable will be assigned with current date and time. You can also change this and set it to the date of your choice.

    2. OffsetValue – Variable of type Int32. This will hold the offset value. For this example, I am choosing the offset value to be in terms of days. So, I have set it to a value of 7.

    3. OffsetDate – Variable of type DateTime. Select this variable and press F4 to view the properties. Change the property EvaluateAsExpression to True. Set the Expresstion to the value DATEADD( "dd", @[User::OffsetValue] , @[User::TodaysDate] ). This expressions adds the offset value to the variable TodaysDate so you get the new OffsetDate.

    4. FormattedDate – Variable of type String. Select this variable and press F4 to view the properties. Change the property EvaluateAsExpression to True. Set the Expresstion to the following value

    RIGHT((DT_STR,4,1252)YEAR(DATEADD("dd",0, @[User::OffsetDate] )),4) +""+
    RIGHT("0" +(DT_STR,4,1252)MONTH(DATEADD("dd",-1,@[User::OffsetDate])),2)+""+
    RIGHT("0" +(DT_STR,4,1252)DAY(DATEADD("dd",0,@[User::OffsetDate])) ,2)

    The only difference is you are formatting the date of your choice, here in this case the value in variable OffsetDate. This variable will hold the date that has already been offset.

    The below screenshot shows a sample. The variable TodaysDate is set to 11/28/2011. Adding 7 days to the variable sets the field OffsetDate to 12/05/2011. As you can see, the variable FormattedDate formats the newly offset date to 20111205.

    This example can also be done with one less variable by eliminating the variable TodaysDate. You can also have one offset variable for each type like days, months and years. It all comes down to ones’ preference.

    Example

    I hope this is what you were looking for and probably gives you an idea of how to achieve this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This below codes give me error below: How to generate this codes help me
I have a code like this below, which gives me a $link that equals
I have a large number of csv files that look like this below: xxxxxxxx
I have 3 collection datatable that shows in this below Month: January ID NAME
I'm doing a homework project that requires this: Below you will find the code
In this below program i am printing the contents of the div when i
In my project i used this below function public function createIconMenu():NativeMenu{ var iconMenu:NativeMenu =
How can I make something like this below work? <?PHP $_SESSION['signup_errors']['test1']; $_SESSION['signup_errors']['test2']; $_SESSION['signup_errors']['test3']; $_SESSION['signup_errors']['test4'];
How do I add CDATA to the ViolationInfo in this below XML <Violations ViolationNo=1
This code below is for executing ls -l | wc -l. In the code,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.