0

I want add 3 months future date with click of button.

code attached to the button is

let YR := year(Date);
let MO := month(Date);
let DY := day(Date);
let DT := date(YR, MO + 1, DY);
for i from 0 to 3 do
let j := (create Register);
j.(Date := DT);
MO := MO + 1
end

 

it is adding 3 records with same date, I want each record to increments by 1 month. Any help would be appreciated.

2 replies

null
    • Sean
    • 4 yrs ago
    • Reported - view

    DT is defined before the loop and won't update the way you have it. You can put...

     

    DT := date(YR, MO, DY)

     

    after MO := MO + 1 in the loop and it should work.

    • subzwari
    • 4 yrs ago
    • Reported - view

    Thanks, Add MO+1 in date function function after MO:= MO+1 and now it works.

Content aside

  • 4 yrs agoLast active
  • 2Replies
  • 1121Views