Easy sum query

pdbowling

Registered User.
Local time
Today, 23:11
Joined
Feb 14, 2003
Messages
179
Hey, for some reason, my higher faculties are not functioning today. I'm looking at this query and am kicking myself that it's not coming out.


Table:Equipment

ID........PM..............Norm.........Abnorm.......InstallDate
F001....$50............$250.........$75.............data
F002....data...........data.........data.............data
...


All I'm trying to do is query out

ID.........Total..........InstallDate
F001.....$375..........data
F002...

I can get ID and total out but have trouble with installDate

SELECT ID, sum(pm+norm+abnorm)
FROM table group by truck

works but how do I add installDate the query?

SELECT ID, sum(pm+norm+abnorm), installDate
FROM table group by truck

asks for an aggregate or function

Any clues out there?
PB
 
Get the records by date first, then run a sum query on the date records query.
 
I have a similar application, only I substract two currency values.

SELECT Dispatch.Source, Sum(Dispatch.AmtBilled) AS SumOfAmtBilled, Sum(Dispatch.AmtPaid) AS SumOfAmtPaid,SumOfAmtBilled-SumOfAmtPaid AS Expr1
FROM Dispatch
GROUP BY Dispatch.Source;

Dispatch is my table and source, AmtBilled, and AmtPaid are fields.

HTH
 

Users who are viewing this thread

Back
Top Bottom