QBF problem? or just me?

CrazyKillerMan

Registered User.
Local time
Today, 16:40
Joined
Nov 26, 2002
Messages
23
Maybe someone out there can tell me what I am doing wrong. Cause I am loosing my mind today!!!

SELECT tbl_equipment.Equipment, Sum(tbl_log.[Off Time]) AS [Off Time]
FROM tbl_equipment INNER JOIN tbl_log ON tbl_equipment.Equipment = tbl_log.Equipment
WHERE (((tbl_equipment.Equipment)=[Forms]![frm_equip_outtage]![combo_equipment]));


Gives me the error: "You tried to execute a query that does not include the specified expression 'Equipment' as part of an aggregate function."

What gives? This is a failry simple query. What I want to accomplish is totaling the Off Time for the equipment that the user selects. Is this impossible (nothing is really impossible in Access is it?).
 
You need to add a Group By clause at the end of the SQL statement:

SELECT tbl_equipment.Equipment, Sum(tbl_log.[Off Time]) AS [Off Time]
FROM tbl_equipment INNER JOIN tbl_log ON tbl_equipment.Equipment = tbl_log.Equipment
WHERE (((tbl_equipment.Equipment)=[Forms]![frm_equip_outtage]![combo_equipment]))
GROUP BY tbl_equipment.Equipment;
 
Jon k

I still have hair thanks to you.

Worked like a charm.
 

Users who are viewing this thread

Back
Top Bottom