Sage X3 end-date of a month

X3 4GL function that returns the end-date of a month

Funprog F_ENDOFMONTH(PMONTH,PYEAR)
Value Integer PMONTH
Value Integer PYEAR
Local Date YD

PMONTH += 1
If PMONTH > 12 Then
PMONTH = 1
PYEAR += 1
Endif

YD = gdat$(1,PMONTH,PYEAR) - 1

End YD

to test the function execute something like that:

Infbox num$(func F_ENDMONTH(11,2015))

One Reply to “Sage X3 end-date of a month”

Leave a Reply

Your email address will not be published. Required fields are marked *