Results 1 to 18 of 18

Thread: Combining three queries [Resolved]

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    116

    Resolved Combining three queries [Resolved]

    Ref:
    1. http://www.vbforums.com/showthread.php?t=328403 for table descriptions
    2. http://www.vbforums.com/showthread.php?t=328505 for some of the query stuff I was doing last night
    3. http://www.vbforums.com/showthread.php?t=240883 for details of someone who wanted something similar

    I'm trying to combine three queries to produce a report for each member, passing the parameter intMemID into a query to return:
    1. The member's name
    2. The number of sessions they have been to
    3. The total number of sessions that have occurred

    Using the following, I can get all of the information:
    (SELECT Forenames & Chr(32) & Surname FROM Members WHERE MemID = intMemID)
    UNION ALL
    (SELECT Count(MemID) AS SessionsAttended FROM RegMem WHERE MemID = intMemID)
    UNION ALL
    (SELECT COUNT (SDate) FROM (SELECT SDate FROM RegMem GROUP BY SDate))

    But my question is, how do I modify the query so that instead of having the data displayed in 3 separate rows, it is displayed as 3 fields in one row?

    I've been messing around with INNER JOIN for about an hour now to get what I want, and it's just not coming.
    Last edited by olamm2k; Mar 13th, 2005 at 12:11 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width