Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting and joining Part II

Status
Not open for further replies.

emozley

Technical User
Jan 14, 2003
769
GB
I have tried to extend the query so that it also performs a similar operation with another table this one called ExternalAttendees but the values are returned for exttotal and extnotarrived are always the same as inttotal for some reason. Thanks very much.

SELECT M.StartTime, M.EndTime, M.MeetingID, M.Provisional, M.Food, count(A.MeetingID) AS inttotal, Sum(IIf(A.Arrived,0,1)) AS intnotarrived, count(E.MeetingID) AS exttotal, Sum(IIf(E.Arrived,0,1)) AS extnotarrived
FROM (Meetings AS M LEFT JOIN Attendees AS A ON A.MeetingID=M.MeetingID) LEFT JOIN ExternalAttendees As E ON E.MeetingID=M.MeetingID
WHERE M.Date=#2/1/2006# And M.RoomID=5
GROUP BY M.StartTime, M.EndTime, M.MeetingID, M.Provisional, M.Food
ORDER BY M.StartTime;


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top