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

Sum

Status
Not open for further replies.

brbarto

Technical User
Sep 6, 2001
34
0
0
How can I do something like this in code?
Sum(price*quantity)

Thanks(very new to access/VBA)
 
Create a query. You should use the query builder in design view at first, but after you have got used to it click View|SQL View. Click View|Totals to add the 'total' row to the query designer grid. This will give you what is called a domain aggregate. If a field/column shows 'group by' in it then you are telling the query to return only one row for each distinct value in that column. change a numeric field's total row from 'group by' to 'sum' and that column will become a summed column. After you do this check out the View|SQL View again. You will be much happier in the long run if you get used to writing SQL. If this is too basic for you I apologize. I started out with nothing, and I still have most of it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top