Skip to Content
author's profile photo Former Member
Former Member

Create a dynamic date filter that automatically runs a report for last week

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Aug 12, 2008 at 07:25 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 12, 2008 at 07:28 AM

    OR YOU CAN USE THIS

    MYTAB.MYDATE BETWEEN dbo.DateOnly(getdate())+8 AND dbo.DateOnly(getdate())-1

    i think this works fine

    good luck

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2008 at 09:09 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.