Summing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know this is relatively simple, but can't for the life of me think about
how to do it. I have 1 table with all of my info. Columns are: Date, Inv#,
Comp Name, Fee Charged. I would like to sum the fees, for each company, for
the whole month of December. (ending up with 1 line for each company).

Table ex:
Date Inv# Comp Name Fee
12/1/04 12 ABC $50.00
12/7/04 13 DEF $25.00
12/18/04 14 ABC $25.00

Query Results:

Comp Name Total Fee
ABC $75.00
DEF $25.00

Thanks so much for your help!
 
Hi,
[...] I would like to sum the fees, for each company, for
the whole month of December. (ending up with 1 line for each company).

Table ex:
Date Inv# Comp Name Fee
12/1/04 12 ABC $50.00
12/7/04 13 DEF $25.00
12/18/04 14 ABC $25.00

Query Results:

Comp Name Total Fee
ABC $75.00
DEF $25.00

SELECT [comp name], SUM(fee) AS [Total Fee]
FROM yourtable
WHERE MONTH([date])=12 AND YEAR([date])=2004
GROUP BY [comp name]

should work.

Wolfgang
 
Right on!! Little tweaking and worked like a charm!

Wolfgang Enzinger said:
Hi,
[...] I would like to sum the fees, for each company, for
the whole month of December. (ending up with 1 line for each company).

Table ex:
Date Inv# Comp Name Fee
12/1/04 12 ABC $50.00
12/7/04 13 DEF $25.00
12/18/04 14 ABC $25.00

Query Results:

Comp Name Total Fee
ABC $75.00
DEF $25.00

SELECT [comp name], SUM(fee) AS [Total Fee]
FROM yourtable
WHERE MONTH([date])=12 AND YEAR([date])=2004
GROUP BY [comp name]

should work.

Wolfgang
 
Back
Top