Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
This should be simple but it is the fist time I have had to do this
If I want to have a beginning and ending reporting month variable set at the beginning of my script what is the proper function/syntax
What I want is :
Begin Month Date = 01/01/2012
End Month Date = 06/30/2012
Not sure of the exact syntax or if LET or SET is the proper way to establish.
Thanks in advance,
Steve
Hi Zagzebski,
In that case you can use a string variable, in place of a date variable,
and use it with $() function in your where clause while loading.
Refer attached QVW for details..
The script contains related comments..
HTH,
KD
Hi Zagzebski,
You can use something like this;
LET vStartMonth = MontStart($(vToday));
LET vEndMonth = MonthEnd($(vToday));
Thanks Jereon - Is there a way to hard code the dates I refereence above...Begin Date = 1/1/2012 and End Date= 6/30/2012 in the variable?
Yes you can do it like this:
LET vDate = Date#('2015-12-31');
Hi,
Just another way to do so would be using MakeDate function:
LET vBeginMonthDate = MakeDate(2012, 01, 01);
LET vEndMonthDate = MakeDate(2012, 06, 30);
HTH,
KD
Thanks KD
To utilize the variable what do I need to do? I tried to use it in a table I was loading but it says field not found?
Hi Zagzebski,
Are you planning to use the Begin and End date variables to generate your master calendar data.
or you want to use these variables to filter data from a table while loading?
- KD
KD -
I need to use them in a WHERE clause in a couple of the tables I am loading.
Hi Zagzebski,
In that case you can use a string variable, in place of a date variable,
and use it with $() function in your where clause while loading.
Refer attached QVW for details..
The script contains related comments..
HTH,
KD
Thanks KD - works!
Two quick follow ups:
1. This is part of a transform load so I want these dates to be available when I reload this data into my model. How can I get this so it loads into my variables of my model?
2. Also not 100% sure in the difference between the let variables and the set variables.
Really apprecaite your help on this, thanks again.
Steve