Here's my small contribution to this very helpful PowerBuilder site:
a simple function to find the last day of month of any given date:
f_get_mo_last_day ( date arg_date ) returns date
I couldn't find this function in the PowerScript functions so I wrote my own. If there is another ways to do this, I'd be happy to hear from anybody.
a simple function to find the last day of month of any given date:
f_get_mo_last_day ( date arg_date ) returns date
Code:
date incr_date
integer curr_mo
curr_mo = month(arg_date)
incr_date = arg_date
do while curr_mo = month(incr_date)
incr_date = relativedate(incr_date,1)
loop
return relativedate(incr_date, -1)
I couldn't find this function in the PowerScript functions so I wrote my own. If there is another ways to do this, I'd be happy to hear from anybody.