Day

Description

Obtains the day of the month in a date value.

Syntax

Day ( date )

Argument

Description

date

A date value from which you want the day


Return value

Integer.

Returns an integer (1 to 31) representing the day of the month in date. If date is null, Day returns null.

Examples

These statements extract the day (31) from the date literal 2004-01-31 and set li_day_portion to that value:

integer li_day_portion
li_day_portion = Day(2004-01-31)

These statements check to be sure the date in sle_date is valid, and if so set li_day_portion to the day in the sle_date:

integer li_day_portion
 
IF IsDate(sle_date.Text) THEN
    li_day_portion = Day(Date(sle_date.Text))
ELSE
    MessageBox("Error", &
    "This date is invalid: " &
    + sle_date.Text)
END IF

See also

Date

IsTime

Month

Year

Day method for DataWindows in the section called “Day” in DataWindow Reference.