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))
Advertisements

One thought on “Sage X3 end-date of a month

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s