Results 1 to 9 of 9
  1. #1
    j2curtis64 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2011
    Posts
    56

    Query question

    I have data in the following table.

    MonthStatusCount01-Nov-10Closed1201-Dec-10Closed1201-Dec-10Open201-Jan-11Closed1201-Jan-11Open101-Feb-11Closed1201-Feb-11Open301-Mar-11Closed501-Mar-11Open601-Jun-11Open5
    I want to create a report where I can display the following columns:



    Month Open Issues Closed Issues Totals Issues

    I would use the data provided in the table above. Should I just create two seperate queries (Open and closed) and then join them together? I know an equal join will not work because there are months where i'd have only closed issues but not open (i.e, 11/1/2010)

    Thx
    Last edited by j2curtis64; 07-28-2011 at 02:52 PM. Reason: Sorry....I'll add an attachment

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    You can have closed but no open issues for a date and appears the opposite is also true. Then need to:

    1. A query for just all distinct dates in the table

    2. Two queries, closed and open

    3. Join the 3 queries.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    j2curtis64 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2011
    Posts
    56
    Actually, it is possible to have months that only have open or closed issues. See below.

    If i create a query that joins Open and Closed and use Closed as the primary the Month of June will need return records since it only contains Open issues.
    MonthStatusCountOfStatus11/1/2010Closed1212/1/2010Closed1212/1/2010Open21/1/2011Closed121/1/2011Open12/1/2011Closed122/1/2011Open33/1/2011Closed53/1/2011Open66/1/2011Open5

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Yes, I noticed that, and offered a solution. Have you attempted it?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    j2curtis64 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2011
    Posts
    56
    When I run the query you suggested, the month of June is missing (Open issues only).

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Post SQL statments for analysis.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    j2curtis64 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2011
    Posts
    56
    SELECT [Closed Issues by month].Month, [Open issues by month].[Issues Identified], [Closed Issues by month].[Issues Identified]
    FROM ([Open issues by month] RIGHT JOIN Months ON [Open issues by month].Month = Months.Month) RIGHT JOIN [Closed Issues by month] ON Months.Month = [Closed Issues by month].Month;

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    SELECT [Months].Month, [Open issues by month].[Issues Identified], [Closed Issues by month].[Issues Identified]
    FROM [Closed Issues by month] RIGHT JOIN ([Open issues by month] RIGHT JOIN Months ON [Open Issues by month].Month = Months.Month) ON [Closed Issues by month].Month = Months.Month;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    j2curtis64 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2011
    Posts
    56
    That did it.

    Thx for you help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query question/help
    By 9944pdx in forum Queries
    Replies: 4
    Last Post: 12-12-2017, 08:13 PM
  2. Query Question
    By starhannes in forum Queries
    Replies: 13
    Last Post: 05-06-2010, 04:05 PM
  3. Query Question
    By Guiseppe in forum Queries
    Replies: 5
    Last Post: 03-23-2010, 04:32 PM
  4. Query with a question
    By sagit3 in forum Queries
    Replies: 0
    Last Post: 06-11-2009, 07:10 AM
  5. Query Question
    By blewis in forum Queries
    Replies: 0
    Last Post: 04-16-2009, 01:37 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
  •  
Other Forums: Microsoft Office Forums