on 08-12-2008 8:18 AM
I would like to create a filter to use in my reports that takes todays date minus 1 day for the end date and takes todays date minus 8 days for the beginning date.
I can then schedule my reports to run every week and know that the filter is looking at the correct date range.
Does anyone have the correct way to go about this? (MSQL 2005)
Regards, GK
Regarding BI you can do something like these:
just take a variable suppose f_DateFilter
now edit the variable like this
f_DateFilter =If(CurrentDate()>=RelativeDate(CurrentDate();-8) And CurrentDate()<=RelativeDate(CurrentDate();-1);1;0)
Now in report designer window, select the whole report and press the Show Hide Filter Pane. and just drag the variable on filter area. A promt will come this time. Just add 1 in the promt box and press OK Button. Just do it. I think it will be worked
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OR YOU CAN USE THIS
MYTAB.MYDATE BETWEEN dbo.DateOnly(getdate())+8 AND dbo.DateOnly(getdate())-1
i think this works fine
good luck
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can create a predefined filter in your universe, and put this folder to the report. so you can schedule the report as you want wihout entering any parameters.
there is a function called getdate() in MS SQL2005
im not much into MS SQL 2005 but you can try this in your filter
MYTAB.MYDATE BETWEEN GETDATE()-8 AND GETDATE-1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.