|
-
Mar 11th, 2005, 05:59 AM
#1
Thread Starter
Lively Member
Counting members & selecting names [Resolved]
Hi,
I'm using the same tables as in my previous post ( http://www.vbforums.com/showthread.php?t=328403 ), but I now need to count the number of members present on a date.
The query I have so far is:
SELECT Members.MemID, COUNT(RegMem.MemID) AS NumPresent FROM Members LEFT JOIN RegMem ON Members.MemID = RegMem.MemID GROUP BY Members.MemID;
This returns a list of MemIDs against the number of sessions that they have been to, but I also need the names of the members, which are contained in the Members table and are matched uniquely to their MemID. I could do this in a second query, moving through each MemID in the first query to obtain a name, but I think it's possible in one query. I don't need the MemID returned and I can't just GROUP BY Surname because some members are siblings.
Any ideas?
Last edited by olamm2k; Mar 12th, 2005 at 03:23 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|