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

Returns

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

Examples

Example 1

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)

Example 2

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