Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing variables

Status
Not open for further replies.

zencalc

IS-IT--Management
Feb 27, 2002
67
US
I have a report that lists the number of orders for many hundred of vendors. I am grouping by the vendor and then want to display the count of the orders, with just the total counts displayed for each vendor, for 2001, 2002, 2003nad then sum total for the three years. I wrote a formula to assign variables as counters for the year, but how do I display them as they are inside one formula. Here is the formula:
numbervar orders2001;
numbervar orders2002;
numbervar orders2003;

if ({orders.RecDate} >= Date (2000,01,01) and {orders.RecDate} <= Date (2000,12,31) )
then orders2001 = orders2001
else
if ({orders.RecDate} >= Date (2001,01,01) and {orders.RecDate} <= Date (2001,12,31) )
then orders2001 = orders2001 + 1
else
if ({orders.RecDate} >= Date (2002,01,01) and {orders.RecDate} <= Date (2002,12,31) )
then orders2002 = orders2002 + 1
else orders2003 = orders2003+1

Any help is appreciated, thanks!
Brian
 
Brian,

The method I have used successfully in the past is as follows:

1. The detail line for each vendor should have 3 counts (1 count per year, 1 year per column) and each of these will be a formula. Formula A (for 2001) will be something like...

&quot;
Code:
if  ({orders.RecDate}  >= Date (2001,01,01) and {orders.RecDate}  <= Date (2001,12,31)  )
then 1 else 0
&quot;.

Repeat for formulas B and C adjusting dates as appropriate.

2. In the group footer, add a field which is a Sum of Formula A. Repeat for B and C. Move the group header details (the vendor name, number, etc) to the group footer.

3. Hide the group header and the detail line. This will ensure only the group footer is printed for each vendor.

4. In the report footer, format your grand totals as fields which are a Sum of the Sum of Formulas A, B and C.


The effect should be something like this...
Code:
===========================================================
PG HDR - vendor no | vendor name |  2001  |  2002  |  2003  
===========================================================
GP FTR -     12345 | vendor 1    |    542 |  12345 |    211 
----------------------------------------------------------- 
GP FTR -     12398 | vendor 2    |    212 |    679 |   1143 
===========================================================
PG FTR -           GRAND TOTALS  |    754 |  13024 |   1354
===========================================================
Good luck,

Dave.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top