Skip Headers

Oracle® OLAP DML Reference
10g Release 1 (10.1)

Part Number B10339-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

YYOF

The YYOF function returns an INTEGER in the range of 1000 to 9999, giving the year in which a specified date falls. The result returned by YYOF has the same dimensions as the specified date expression.

Return Value

INTEGER

Syntax

YYOF(date-expression)

Arguments

date-expression

An expression that has the DATE data type, or a text expression that specifies a date. See"TEXT-to-DATE Conversion".

Notes


TEXT-to-DATE Conversion

In place of a date expression, you can specify a text expression that has values that conform to a valid input style for dates. YYOF automatically converts the values of the text expression to DATE values, using the current setting of the DATEORDER option to resolve any ambiguity.


Commas in Year Values

When the COMMAS option is set to YES when you display the value returned by YYOF, the year is displayed with a comma separating the thousands (for example, 1,996). To avoid this, you can set the COMMAS option to NO before displaying the year.

Examples

Example 24-47 Obtaining the Current Year

The following statements send the year in which today's date falls to the current outfile.

COMMAS = NO
SHOW YYOF(TODAY)

When today's date is January 15, 1996, these statements produce the following output.

1996