How to Add Years to a Date ExpressionLast reviewed: June 27, 1995Article ID: Q128069 |
The information in this article applies to:
Use the fuction GOMONTH() to add years to a date expression. GOMONTH() returns the date that is a specified number of months before or after a given date or datetime expression. Here's the syntax:
GOMONTH(<expd>,<expN>)The <expd> specifies a date expression for which GOMONTH() returns the date. The <expN> specifies the number of months from the date or datetime. If <expN> is positive, GOMONTH() returns a date that is <expN> months after the date. If nNumberOfMonths is negative, GOMONTH() returns a date that is <expN> months before the date. For example, if you have a date expression in a variable like this:
mydate = {03/03/95} && Enter this in the Command window ? mydateAnd you want to add a number of years to that date, as shown here:
addyears=3 && Enter this in the Command window ? addyearsYou could use the GOMONTH() function as in this example:
newdate=GOMONTH(mydate,12 * addyears) && Enter this in the Command window ? newdate |
Additional reference words: FoxWin 2.60a
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |