Oracle® OLAP DML Reference 10g Release 1 (10.1) Part Number B10339-02 |
|
|
View PDF |
The ENDDATE function returns the ending date of the last time period for which an expression has a non-NA
value.
Note: You can only use this function with dimensions of type DAY, WEEK, MONTH, QUARTER, or YEAR.You cannot use this function for time dimensions that are implemented as hierarchical dimensions of type TEXT. |
Return Value
DATE
Syntax
ENDDATE(expression)
Arguments
The expression must have exactly one dimension that has the type of DAY, WEEK, MONTH, QUARTER, or YEAR.
Notes
When all the values of the expression are NA
, ENDDATE returns NA
.
ENDDATE returns the final date of the last time period in the dimension status for which the expression has a non-NA
value. For example, when an expression is dimensioned by MONTH, and when DEC98
is the last dimension value for which the expression has a non-NA
value, ENDDATE returns the date December
31,
1998
.
When you display the result returned by ENDDATE, the date is formatted according to the date template in the DATEFORMAT option. When the day of the week or the name of the month is used in the date template, the day names specified in the DAYNAMES option and the month names specified in the MONTHNAMES option are used. You can use the result returned by ENDDATE anywhere that a DATE value is expected.
You can also use the result where a text value is expected. The date is automatically converted to a text value, using the current template in the DATEFORMAT option to format the text value. When you want to override the current DATEFORMAT template, you can convert the date result to text by using the CONVERT function with a date-format argument.
The BEGINDATE function, which returns the first date for which an expression has a non-NA
value.
Examples
Example 11-25 Finding the End Date
The following statements limit the values of the dimensions of the units
variable, then sends the last date associated with a non-NA
value to the current outfile.
LIMIT month TO ALL LIMIT product TO 'Tents' LIMIT district TO 'Chicago' SHOW ENDDATE(units)
These statements produce the following output.
31DEC96