DayOfYear()

Category: Date

Syntax: DayOfYear ( date )

Parameters:

DateAny valid date (1/1/000112/31/4000), expression that returns a date, or field that contains a date. The parameter can also be the numeric representation of a date (11460970).

Data type returned: Number

Description:

Returns a number representing the day of year (1366) for any valid date (1/1/000112/31/4000).

You can use the DayOfYear function to check whether a particular year is a leap year. Given a field Year, the formula DayOfYear ( Date ( 12; 31; Year )) would return 366 if Year was a leap year, and 365 if it wasn't.

Note that the year is optional. DayOfYear ("12/1") will return the appropriate integer for December 1st in the current year.

Examples:

Function

Results

DayOfYear ( "12/31/2000" )

Returns 366 (leap year).

DayOfYear ( "12/31/2001" )

Returns 365 (nonleap year).

DayOfYear ( "1/24/2004" )

Returns 24.

DayOfYear ( dateField )

Returns the day number for the date stored in dateField.

DayOfYear ( Get ( CurrentDate ) + 30 )

Returns the day of year for a date 30 days from now.

Категории