We use this code.
/*
-SET &THIS_MN = EDIT(&MDYY,'99') ;
-SET &THISQTR = DECODE &THIS_MN('01' 'Q1' '02' 'Q1' '03' 'Q1' '04' 'Q2' '05' 'Q2' '06' 'Q2'
- '07' 'Q3' '08' 'Q3' '09' 'Q3' '10' 'Q4' '11' 'Q4' '12' 'Q4' ELSE 'TQ');
-SET &PREVQTR = DECODE &THISQTR('Q1' 'Q4' 'Q2' 'Q1' 'Q3' 'Q2' 'Q4' 'Q3' ELSE 'LQ') ;
-SET &PREV_YY = IF &PREVQTR EQ 'Q4' THEN (&THIS_YY - 1) ELSE &THIS_YY ;
-*-TYPE *********************************************************************
-*-TYPE *** &DATEYYMD IS IN &THISQTR &THIS_YY, THE PREVIOUS QUARTER IS &PREVQTR &PREV_YY
-SET &PREVQBEG = DECODE &PREVQTR('Q1' '01' 'Q2' '04' 'Q3' '07' 'Q4' '10');
-SET &PREVQBEGY= &PREV_YY || '/' || &PREVQBEG || '/' || '01' ;
-SET &PREVQBEGM= &PREVQBEG || '/' || '01' || '/' || &PREV_YY ;
-SET &PREVQEND = DECODE &PREVQTR('Q1' '03' 'Q2' '06' 'Q3' '09' 'Q4' '12');
-SET &PREVQEND = &PREVQEND || '01' || &PREV_YY ;
-SET &PREVQEND1= DATECVT(&PREVQEND,'I8MDYY','MDYY');
-SET &PREVQEND2= DATEMOV(&PREVQEND1, 'EOM');
-SET &PREVQEND3= DATECVT(&PREVQEND2,'MDYY','A8MDYY');
-SET &PREVQEND4= DATECVT(&PREVQEND,'MDYY','MDYY');
-SET &PREVQENDM= EDIT(&PREVQEND3,'99') || '/' ||EDIT(&PREVQEND3,'$$99') || '/' || EDIT(&PREVQEND3,'$$$$9999') ;
-SET &PREVQENDY= EDIT(&PREVQEND3,'$$$$9999') || '/' || EDIT(&PREVQEND3,'99') || '/' || EDIT(&PREVQEND3,'$$99');
-*-TYPE *** FROM, PREVQBEGY: &PREVQBEGY, TO, PREVQENDY: &PREVQENDY [YMD]
-*-TYPE *** FROM, PREVQBEGM: &PREVQBEGM, TO, PREVQENDM: &PREVQENDM [MDY]
-*-TYPE *********************************************************************
-* SAMPLE OUTPUT BASE ON 20070215
-* *******************************************************************
-* *** 2007/02/15 IS IN Q1 2007, THE PREVIOUS QUARTER IS Q4 2006
-* *** Q4 2006 REPORTING PERIODS, FROM: 2006/10/01, TO: 2006/12/31
-* *******************************************************************
-SET &DATE1 = &PREVQBEGY ;
-SET &DATE2 = &PREVQENDY ;
*\
I hope that this helps
WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit