ADDMONTH

Contents


addmonth allows you to add a number of months to a date.

 

Syntax

   addmonth(date_exp, num_exp)

 

Parameters

Element

Description

Restrictions

date_exp

Date Expression

None

num_exp

Any Numeric Expression

None

 

Examples

   # Date of the previous month
    PREC = addmonth(date$,-1)
   # What day will it be in one month?
    JOUR = day$(addmonth(date$,1))
   # Date Calculation
    ECHEANCE = addmonth(gdat$(JOUR,MOIS,ANNEE),DELAI)

 

Description and Comments

The addmonth function allows you to add a number of months to a date. If this number is negative or greater than 12, it is recalculated and the correction is made for the year. The result is the Date type.

 

Associated Errors

Error

Description

ERDATE (56

Date invalid

ERMODE (10)

Type parameter invalid

 

Associated Keywords

DAY  -  DAY$  -  MONTH  -  MONTH$  -  YEAR  -  DAYN  -  NDAY  -  NDAY$  -  DATE$  -  DATESYSTGDAT$  -  EOMONTH


CONTENTS


Copyright © Sage 1999 - 2007