Quantcast
Channel: Answers by "Jason Crider"
Viewing all articles
Browse latest Browse all 15

Answer by Jason Crider

$
0
0

The minus sign was really the problem. I had tried the way that Jay mentioned before and I never could quite get the negative days to work.

Here's how I finally got it to work.

The number of days to subtract from the current day is assigned to a variable of type Int32 named gvCalDays. So in this example a value of 2 comes in.

I created another variable called gvCalDaysWithMinus as type String with EvaluateAsExpression set to True and expression of " -" + (DT_STR, 4, 1252) @[User::gvCalDays]. This gets me my number of days with a minus sign.

Then I want to use that in the DateAdd so I created another variable called StartDate with DateTime type. I set EvaluateAsExpression to true and gave it the value DATEADD("dd", (DT_I4)@[User::gvCalDaysWithMinus], @[User::gvDate]).

That finally got me to where I need to be. I'm sure they may be other ways of doing this but it sure was giving me trouble. Thanks for the help.


Viewing all articles
Browse latest Browse all 15

Trending Articles