Obtains the day of the month in a date value.
Day ( date )
Argument |
Description |
---|---|
date |
A date value from which you want the day |
Integer. Returns an integer (1 to 31) representing the day of the month in date. If date is null, Day returns null.
These statements extract the day (31) from the date literal 1994-01-31 and set li_day_portion to that value:
integer li_day_portion
li_day_portion = Day(1994-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