Partager via


GOMONTH( ) Function

Returns the date that is a specified number of months before or after a given Date or DateTime expression.

GOMONTH(dExpression | tExpression, nNumberOfMonths)

Return Values

Date

Parameters

  • dExpression
    Specifies a date expression for which GOMONTH( ) returns the date.
  • tExpression
    Specifies a datetime expression for which GOMONTH( ) returns the date.
  • nNumberOfMonths
    Specifies the number of months from the date or datetime. If nNumberOfMonths is positive, GOMONTH( ) returns a date that is nNumberOfMonths months after the date or datetime. If nNumberOfMonths is negative, GOMONTH( ) returns a date that is nNumberOfMonths months before the date or datetime.

Remarks

GOMONTH( ) does not support dates earlier than 1752.

Example

SET CENTURY ON
STORE GOMONTH({^1998-02-16}, 5) TO gdDeadLine

CLEAR
? gdDeadLine  && Displays 07/16/1998
? GOMONTH({^1998-12-31}, 2)  && Displays 02/28/1999
? GOMONTH({^1998-12-31}, -2)  && Displays 10/31/1998

See Also

CMONTH( ) | BuildDateTime Property | DATETIME( ) Function