PB Version 7
date ld_date,ld_date2
this.accepttext()
choose case dwo.name
case "d_column_1"
ld_date = this.getitemdate(1,"d_colu
mn_1")
ld_date2 = relativedate(ld_date, 32)
ld_date2 = relativedate(ld_date2,day(
ld_date2)*
-1)
this.setitem(1,"d_column_2
",ld_date2
)
end choose
The above script find last date of the same month for any given date. This works fine for all dates except when the starting date is already last of the month. For example, When start_date is June 30, 2008 the end_date calculated by the above script is July 31 2008 instead of June 30 2008.
What is the Problem?
Start Free Trial