Topic
1 reply Latest Post - ‏2013-03-11T16:32:02Z by SystemAdmin
Pete416
Pete416
1 Post
ACCEPTED ANSWER

Pinned topic Use past 24 hours in filtering

‏2013-03-01T21:14:54Z |
Ken,

I just watched your video on how to setup a report, with dropdown selections, to show just the last 24 hours (just like the older Operational reporting used to do. I am trying to create a report, of failed backups in the last 24 hours, from scratch. I always want this report to only show the backups scheduled within the last 24 hours. So far, I've got the report, using filtering, to show the data, since yesterday (i.e. a set date and time), which uses the expression definition of

Schedule Start Date/Time >= _add_days(current_date, -1 * 1).</quote>

What do I have to change to get this to use the past 24 hours?

Thanks,
Peter
Updated on 2013-03-11T16:32:02Z at 2013-03-11T16:32:02Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    28 Posts
    ACCEPTED ANSWER

    Re: Use past 24 hours in filtering

    ‏2013-03-11T16:32:02Z  in response to Pete416
    Thank you for your post!

    The query/filter needs to be changed to reflect 'now' minus one 24 hour period which is 1 day. The video shows you to use the filter below:

    between cast(_add_days({current timestamp}, -1_ as TIMESTAMP) and cast({current timestamp} as TIMESTAMP)

    This tells the DB2 engine to only query from the database, those rows with the start date of now - 1 day (will not affect hours or minutes) and now. You will need to apply this to the column you are intersted in filtering, so it will say something like

    start_time between cast (_add_days.....