Evaluates a date expression and returns a month INTEGER value from 1 to 12, inclusive.
Syntax
MONTH ( date )
MONTH ( datetime-expression )
date
A date expression where you want a month value.
datetime-expression
An expression that evaluates to a DATETIME or DATETIME-TZ. The MONTH function returns the month of the date part of the DATETIME or DATETIME-TZ value.
Example
This procedure displays all the Orders that have a PromiseDate in a month that has passed, and whose ShipDate field is the Unknown value (?), which is the initial value of the ShipDate field:
r-mon.p
FOR EACH Order NO-LOCK:
IF (MONTH(Order.PromiseDate) < MONTH(TODAY) OR
YEAR(Order.PromiseDate) < YEAR(TODAY)) AND Order.ShipDate = ? THEN
DISPLAY Order.OrderNum LABEL "Order Num" Order.PO LABEL "P.O. Num"
Order.PromiseDate LABEL "Promised By"
Order.OrderDate LABEL "Ordered" terms
WITH TITLE "These orders are overdue".
END.