| iiYear | input | integer | Year |
| iiMonth | input | integer | Month |
| iiMonthPos | input | integer | Indicaters what month do you want to get the last day of. Supported values: 0 = last day of iiMonth 1 = last day of iiMonth + 1. |
QadFinancials
/*iiYear and iiMonth are mandatory*/
if iiYear = 0 or
iiYear = ? or
iiMonth = 0 or
iiMonth = ?
then return ?.
if iiMonthPos = ?
then assign iiMonthPos = 0.
case iiMonthPos:
/*get the last ady of the current month*/
when 0
then return date(/*Month*/
if iiMonth >= 12
then 1
else iiMonth + 1,
/*Day*/
1,
/*Year*/
if iiMonth >= 12
then iiYear + 1
else iiYear) - 1.
/*get the last day of the next month*/
when 1
then return date(/*Month*/
if iiMonth = 11
then 1
else if iiMonth = 12
then 2
else iiMonth + 2,
/*Day*/
1,
/*Year*/
if iiMonth >= 11
then iiYear + 1
else iiYear) - 1.
otherwise return ?.
end case.