Navigation:  Macros > Macro Language > Built-in Functions > All Functions (Alphabetical) >


Previous pageReturn to chapter overviewNext page

Int = MoveMonths(nDate, nMoveBy)


This macro function returns a date up or down by a certain number of months, to the first of that month.


ØThe result of this function will always be the first of some month, regardless of the date number of nDate.
ØTip : if you need the last of the month, increase nMoveBy by one and then subtract one from the result (see the last example below).




nFirstOfNextMonth = MoveMonths(Today(),1)

nFirstOfThisMonth = MoveMonths(Today(),0)

nFirstOfLastMonth = MoveMonths(Today(),-1)

nEndMonth = Add(MoveMonths(Today(),1),-1)

Topic 108269 updated on 09-Feb-2006.
Topic URL: