DAY operator returns the day portion of its DATE or DATETIME operand:
The returned value is a positive integer.
DAY() operator is helpful in the applications where arithmetic operations are performed with DATE or DATETIME values because INTEGER values are easier to manipulate with arithmetic operators than DATETIME or DATE ones.
This example program shows how the DAY() operator can be used:
MAIN
DEFINE my_date DATE
LET my_date = TODAY
DISPLAY "Today is ", my_date
DISPLAY "Date: ", trim(DAY(my_date))
DISPLAY "Month: ", trim(MONTH(my_date))
DISPLAY "Year: ", trim(YEAR(my_date))
END MAIN