Forums

ASP

This topic is locked

selecting within a selection ...

Posted 04 Jun 2002 15:05:07
1
has voted
04 Jun 2002 15:05:07 sia sias posted:
heya, I'm using Access and Vbscript ...

I have a field called 'Results' in a query that calculates two other fields for me dynamically, the 'quantity' and 'price' fields.

I can calculate the Total amount for each user easily enough, by filtering the query by the 'UserID' field and adding up the results on the page itself, but I now need to do that for all users on the one page without displaying all their individual orders, just their Name and Total.

Is there some syntax for selecting all records then selecting all records with the same 'UserID' and then totaling the 'Results', then looping onto the next one?

I calculate the Total by declaring a variable of 0, then adding each 'Result' every loop.

Im at a bit of loss to make this work here ...

hope this makes sense - all help will be appreciated <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic