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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Still confused on categorization grouping!

Status
Not open for further replies.

ombina

Programmer
Jun 18, 2002
62
US
Hi,

Tharwn helped me with this but still can't get all of the elements down.

Here's what we have in concept:

1) SQL Query
2) Execute into RS
3) Declare a temporary variable to hold catagory (tempCat) and initialize to ""
3.5) declare runningTotal and set to 0
4) Do Until rs.eof
5) if tempCatagory <> rs(&quot;catagory&quot;) then
a.5) if tempCat <> &quot;&quot; then output a row with total for last catagory
a) output the catagory
b) set the tempCat variable = rs(&quot;catagory&quot;)
6) output the record as usual
6.5) increment the total from whatever field in the recordset or increment by 1 for a recordcount in this catagory
7) rs.MoveNext
8) Loop
9) if tempCat <> &quot;&quot; then output a row with total for last catagory

Here's my actual result:

Cat A Record Counts
------ -------------
prod 1 500
prod 3 1000
====== =============
Total 1500

Cat B Record Counts
------ -------------
prod 5 2500
prod 8 41000
====== =============
Total 43500

I need help getting the &quot;Cat A&quot; Total line there. I have the very last Total okay. Please HELP!!!

Thanks,

Ricky Thanks,

Ricky Ombina
ombina@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top