ken bohnenkamp
9th March 2011, 15:49
Does anyone know of a function to calculate the number of months from a given date?

george7a
9th March 2011, 16:30
I assume you need to know the number of month in between a period

Lets say the period from D1/M1/Y1 to D2/M2/Y2. The simplest number of months will be (ignoring the days)

(M2-M1) + (Y2-Y1)*12

amitmmokashi
10th March 2011, 06:05
Hi,
The function num.to.date() can be used to retrieve the year, month and days.


BaanERP Programmers Guide 7.6_a


num.to.date()

--------------------------------------------------------------------------------

Syntax
long num.to.date( long dayno, ref long yearno, ref long monthno, ref long month_dayno )

Description
This converts a specified number of days since 01-01-0001 to the corresponding year, month, and day of the month.

Return values
0 Success.

-1 Error.


Context
Bshell function.