Calculating previous quarter start and end

brebre Member Posts: 19
What i am doing wrong?
I want to calculate the end date of the previous quarter.

If i do:
testdate := 290307d;
QuarterEnd := calcdate( '<CQ>', testdate);

then QuarterEnd shows me 2007/03/31 == Correct
--
If i do:
testdate := 290607d;
QuarterEnd := calcdate( '<CQ -1Q>', testdate);

then QuarterEnd shows me 2007/03/30 == Incorrect, missing 1 Day

Comments

  • CerroMaggioreBoyCerroMaggioreBoy Member Posts: 6
    try this

    testdate := 290607d;
    QuarterEnd := calcdate( '<CQ -1Q -CM>', testdate);

    CM constant carry your date at the end or init of the month.
    -CM or +CM determines the way you want to arrive at the end or at the init of the month.

    try this.

    bye
Sign In or Register to comment.