I have a formula which calculates dates in a quarter and is used in a running total in the report footer which gives the correct result as follows:
@Quarter
if({SALES.SALES_DATE}in Date (2003, 04, 01) to Date (2003, 06, 30)) then 'Q1' else
if({SALES.SALES_DATE}in Date (2003, 07, 01) to Date (2003, 09, 30)) then 'Q2' else
if({SALES.SALES_DATE}in Date (2003, 10, 01) to Date (2003, 12, 31)) then 'Q3' else
if({SALES.SALES_DATE}in Date (2004, 01, 01) to Date (2004, 03, 31)) then 'Q4'
#Q3
not isnull({CLIENTS.CLIENT_NO})
and
isnull({CLIENTCOM.CLIENTCOM_NO})
and
{@Quarter}='Q3'
//Returns 442
Then I created a new formula which calculates a second set of dates in a rolling quarter as follows:
@RQuarter
if({SALES.SALES_DATE}in Date (2002, 07, 01) to Date (2003, 06, 30)) then 'RQ1' else
if({SALES.SALES_DATE}in Date (2002, 10, 01) to Date (2003, 09, 30)) then 'RQ2' else
if({SALES.SALES_DATE}in Date (2003, 01, 01) to Date (2003, 12, 31)) then 'RQ3' else
if({SALES.SALES_DATE}in Date (2003, 01, 01) to Date (2004, 03, 31)) then 'RQ4'
#Q3R
not isnull({CLIENTS.CLIENT_NO})
and
isnull({CLIENTCOM.CLIENTCOM_NO})
and
{@RQuarter}='RQ3'
//Returns 442
This #Q3R total returns the same count as the #Q3 total even though the dates are completely different and I can't figure out what is wrong with it. Strangely enough it works ok for #Q1 and #Q1R - can you see anything obvious?
Many thanks
jcl5
@Quarter
if({SALES.SALES_DATE}in Date (2003, 04, 01) to Date (2003, 06, 30)) then 'Q1' else
if({SALES.SALES_DATE}in Date (2003, 07, 01) to Date (2003, 09, 30)) then 'Q2' else
if({SALES.SALES_DATE}in Date (2003, 10, 01) to Date (2003, 12, 31)) then 'Q3' else
if({SALES.SALES_DATE}in Date (2004, 01, 01) to Date (2004, 03, 31)) then 'Q4'
#Q3
not isnull({CLIENTS.CLIENT_NO})
and
isnull({CLIENTCOM.CLIENTCOM_NO})
and
{@Quarter}='Q3'
//Returns 442
Then I created a new formula which calculates a second set of dates in a rolling quarter as follows:
@RQuarter
if({SALES.SALES_DATE}in Date (2002, 07, 01) to Date (2003, 06, 30)) then 'RQ1' else
if({SALES.SALES_DATE}in Date (2002, 10, 01) to Date (2003, 09, 30)) then 'RQ2' else
if({SALES.SALES_DATE}in Date (2003, 01, 01) to Date (2003, 12, 31)) then 'RQ3' else
if({SALES.SALES_DATE}in Date (2003, 01, 01) to Date (2004, 03, 31)) then 'RQ4'
#Q3R
not isnull({CLIENTS.CLIENT_NO})
and
isnull({CLIENTCOM.CLIENTCOM_NO})
and
{@RQuarter}='RQ3'
//Returns 442
This #Q3R total returns the same count as the #Q3 total even though the dates are completely different and I can't figure out what is wrong with it. Strangely enough it works ok for #Q1 and #Q1R - can you see anything obvious?
Many thanks
jcl5