Condividi tramite


MONTH( ) Function

Returns the number of the month for a given Date or DateTime expression.

MONTH(dExpression | tExpression)

Return Values

Numeric

Parameters

  • dExpression
    Specifies the Date expression for which you want MONTH( ) to return the month number.
  • tExpression
    Specifies the DateTime expression for which you want MONTH( ) to return the month number.

Remarks

MONTH( ) returns a number from 1 through 12. January is month 1, and December is month 12.

Example

CLEAR
? DATE( )  && Displays today's date
? MONTH(DATE( ))  && Displays the month number
STORE {^1998-05-03} TO gdBuy
STORE MONTH(gdBuy + 31) TO gdMonth
? gdMonth  && Displays 6

See Also

CMONTH( ) | DAY( ) | QUARTER( ) | YEAR( )