DAYOFYEAR

The DAYOFYEAR function returns an integer, in the range of 1 to 366, that represents the day of the year, where 1 is January 1.


DAYOFYEAR-Syntax

The argument must be an expression that returns a value of one of the following built-in data types: a date, a timestamp, a character string, or a graphic string.

If expression is a character or graphic string, it must not be a CLOB or DBCLOB, and its value must be a valid string representation of a date or timestamp with an actual length that is not greater than 255 bytes.

If expression is a timestamp with a time zone value, or a valid string representation of a timestamp with a time zone, the result is determined from the UTC representation of the datetime value.

The result of the function is a large integer.

Example 1:

The following example selects the day part from the given value DATEOFJOIN from the table EMPLOYEE:

   
SELECT DAYOFYEAR(DATEOFJOIN) FROM EMPLOYEE

The above example returns the following.


329

283
331
329
329