queries

1

123xxxxx

how do i add the complete total in a query from each individual record i.e.
i record in a field in each record data, numerical, how would i in a
seperate field add all this up to give me a total
 
1

123xxxxx

is this a valid SQL statement

SELECT Sum(field) FROM TableName

or is there something more to be added???
 
J

John Vinson

is this a valid SQL statement

SELECT Sum(field) FROM TableName

or is there something more to be added???

Well... did you try it?

Yes. This Query will return a single row containing a single field,
the grand total of Field for all records in TableName.

For very flexible grouping, summing, counting and averaging, use a
Totals query. Create a Query based on your table and click the Greek
Sigma icon (looks like a sideways M). By default each field will have
"Group By" on the new Totals row in the query grid; this means that it
will assemble records into groups based on distinct values in these
fields. Change the Group By to Sum (or Count, or Avg, or many other
options) to sum all the values across such a group.
 
1

123xxxxx

yes it did thank you for your help all

John Vinson said:
Well... did you try it?

Yes. This Query will return a single row containing a single field,
the grand total of Field for all records in TableName.

For very flexible grouping, summing, counting and averaging, use a
Totals query. Create a Query based on your table and click the Greek
Sigma icon (looks like a sideways M). By default each field will have
"Group By" on the new Totals row in the query grid; this means that it
will assemble records into groups based on distinct values in these
fields. Change the Group By to Sum (or Count, or Avg, or many other
options) to sum all the values across such a group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top