Specifying actual dates and times in a report you run frequently requires you to change those dates in the job every time you run it. The alternative is to use the relative date and time format. This format creates reports that start or end a certain number of minutes, hours, days, weeks, or months before the current date and time. The date and time you specify is always relative to the time that you run the report.
The relative date and time format is as follows:
-n [MINUTES] [HOURS] [DAYS] [AT hh:mm:ss] [WEEKS] [AT hh:mm:ss] [MONTHS]
Specifies the number of minutes, hours, days, weeks, or months to subtract from the time at which the Report Writer starts running. The number must be an integer, prefixed by a minus sign (-). You can specify zero (-0).
Subtracts n minutes from the time at which the Report Writer starts running. The time is rounded down to the nearest minute for FROM commands, and rounded up to the nearest minute for TO commands. If -n is zero (‑0), the Report Writer rounds the current time down to the nearest minute.
Subtracts n hours from the time at which the Report Writer starts running. The time is rounded down to the nearest hour for FROM commands, and rounded up to the nearest hour for TO commands. If -n is zero (-0), the Report Writer rounds the current time down to the nearest hour.
Subtracts n days from the current date and time. The result is rounded down to the nearest day for FROM commands, and rounded up to the nearest day for TO commands. If -n is zero (-0), the Report Writer rounds the current date and time down to the start of the current day.
Subtracts n weeks from the current date and time. The result is rounded down to the nearest week for FROM commands, and rounded up to the nearest week for TO commands. A week begins on Monday morning at 00:00:00. If -n is zero (-0), the Report Writer rounds the current date and time down to the start of the current week.
Subtracts n months from the current date and time. The result is rounded down to the nearest month for FROM commands, and rounded up to the nearest month for TO commands. If -n is zero (-0), the Report Writer rounds the current date and time down to the start of the current month.
Begins (or ends) the report at the time specified by hh:mm:ss on the day the report is run. The value is rounded down to the nearest day or week for both FROM and TO commands. Valid only with the DAYS and WEEKS operands.
Examples: Actual and Relative Dates and Times
Actual Dates and Times
To report from December 25 2010 at 8:00 a.m. to January 1 2011, use the following commands:
FROM 12/25/10 08:00:00 TO 01/01/11 00:00:00
Relative Dates and Times
To report from the start of the current week (Monday morning at 00:00:00), use the following command:
FROM -0 WEEKS
To report from yesterday at 00:00:00 to the current time, use the following commands. The report is rounded to the last hour.
FROM -1 DAYS TO -0 HOURS
To report from yesterday at 8:00 a.m. to today at 8:00 a.m., use the FROM and TO commands and the AT hh:mm:ss operand as follows:
FROM -1 DAYS AT 08:00:00 TO -0 DAYS AT 08:00:00
To report from yesterday at 8:00 a.m. to yesterday at 4:00 p.m., use the following commands:
FROM -1 DAYS AT 08:00:00 TO -1 DAYS AT 16:00:00
| Copyright © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |