PES_MACRO_DATES returns a set of dates as columns in the results set for the specified time scale and date range. This is useful when getting dates for column headers of reports.
The parameters for this macro are:
- Temporary table name
- Time scale; the possible values are ‘Calendar Year’, ‘Calendar Quarter’, ‘Calendar Month’, ‘Calendar Week’, ‘Calendar Day’, ‘Fiscal Year’ and ‘Fiscal Quarter’
- Start date; the entire bucket containing the start date will be included. For example, if 1/16/2006 is specified and Calendar Month is requested then the entire month of January is returned
- Finish date; similar to Start Date the entire bucket containing this date will be included
The following example shows this macro querying for dates between January and April by calendar month:
SELECT * FROM PES_MACRO_DATES(tmp, Calendar Month, 1/1/2006, 4/30/2006)
Copyright © 2003–2011 Serena Software, Inc. All rights reserved.