Xbasic

CDOW Function

Syntax

Day_of_Week as C = CDOW(D date[,L localized])

Day_of_Week as C = CDOW( D time as T [, localized as L])

Arguments

date

A variable containing a date value or a character string containing a legitimate representation of a date value ( ISDATE (Date_Value) = .T.).

time

A variable containing a date time value.

localized

Logical. A variable containing .T. if a localized date is requested.

Description

CDOW() returns a character string containing the name of the day of the week for the specified Date. If the optional localized flag is true, report the localized day name. (Localized flag requires Version 10.5 or later)

Example

cdow(START) -> "Tuesday", if START contains 11/28/95
cdow( ctod( "05/15/95") ) ->  "Monday"

If you print form letters that mention dates in the body of the letter, you may want to create a field containing the day of the week. For example, "I'll see you on Monday" sounds more personal than "I'll see you on 5/15/95." Assume that your table has a date field, APPOINTMNT, which stores the date for a scheduled appointment. You can include a computed field right in the body of the letter; Alpha Anywhere calculates the expression when the letter is printed. For this letter, the expression is:

cdow(APPOINTMNT)

In Version 10.5, this function has an optional second logical parameter to force the function to honor the machine's regional settings when returning the day name, Localized as L.

See Also