Adding, event hours together... without duplicates

morfusaf

Registered User.
Local time
Today, 15:40
Joined
Apr 24, 2012
Messages
78
I have a database... with 3 tables..

tblEvents
tblPeople
tblPeopleAtEvents

In this database I have a report...

This report displays each person and each event they did...

In the events, i saved a varible called... Detail Hours

I Currently have my adding together total events(without duplicates), using a DCount.... But I can't seem to get my Detail Hours to work... without duplicates... I know I need a query most likely but I have tried a crap ton, with no success... any help?


This is the current code I am using that isn't working(in my query)... Also, I don't know what to use on the form itself... =Sum or DCount or what?....


Code:
 SELECT tblEvents.DetailEventTitle, Sum(tblEvents.[Detail Hours]) AS [SumOfDetail Hours]
FROM tblPeople INNER JOIN (tblEvents INNER JOIN tblPeopleAtEvents ON tblEvents.EventID=tblPeopleAtEvents.EventID) ON tblPeople.PersonID=tblPeopleAtEvents.PersonID
WHERE (((tblEvents.DetailDate) Between Forms!formMemberReports!FlightFDate And Forms!formMemberReports!FlightEDate) And ((tblPeople.HG_Flight)=Forms!formMemberReports!Combo68))
GROUP BY tblEvents.DetailEventTitle;

I was hoping to do a ... Group By DetailEventTitle(to make sure each event is differnt)... then Detail Hours, then in the form do something like Sum(qryDetailHoursTotalDateAndFlight) ... but I can't get that to work... Is there a way to have Detail Hours return a value or something?
 
Hi Morfusaf:
I think I helped you with the DCount previously. I think you can use the DSum function similarly as DCount to do the same thing for your detail hours. Let me know what you come up with.

 
Worked thanks a bunch...
 

Users who are viewing this thread

Back
Top Bottom