DayOfWeek()

Category: Date

Syntax: DayOfWeek ( 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 from 1 to 7, representing the day of week (Sunday = 1, Saturday = 7) for any valid date (1/1/000112/31/4000).

DayOfWeek() can be used to perform conditional tests on days of week without concern for localization issues. The number returned is always the same regardless of what language version of FileMaker Pro the user is using. The number value returned by DayOfWeek() can also be used in mathematical calculations.

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

Examples:

Function

Results

DayOfWeek ( "11/24/2003" )

Returns 2 (Monday).

DayOfWeek ( dateField )

Returns the day of week for the date stored in the field dateField.

DayOfWeek ( Date ( 12; 25; Year ( Get ( CurrentDate ))))

Returns the day number on which Christmas falls this year.

Категории