View Full Version : Column Sum


deejay_totoro
10-15-2003, 03:22 AM
Hello,

This is probably very simple :) but I'd appreciate some help!

I have created a cross-tab query that calculates the number of fields etc... thats fine. The resulting query produces the number information I need (for example, a count of books...)


But, I want to create a (another?) query that will "total" (like excel sum button) all the figures in a particular query column.

For example:

NumberOfBooks 20
NumberOfAuthors 15
NumberOfShops 32
NumberOfSales 23
NumberOfProblems 23

etc...

How may I add together these figures in a query?

Thank you very much!

dj_T

namliam
10-15-2003, 03:32 AM
select Type,count(*)
from yourTable
group by type

Something like above asuming that Type containes the type your looking for....

Regards

deejay_totoro
10-15-2003, 04:00 AM
Hello

Thanks for your reply.

But I dont know what you mean :( sorry!

anyhelp?

dj_T

namliam
10-15-2003, 04:51 AM
select Type,count(Type)
from yourTable
group by type

Paste above SQL into a query replace type by the field which says Books, etc
Replace yourTable by the table name you want

And it should do what you want...

Regards