Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2008
    Posts
    1

    Combining Two Queries

    Hello:

    I am using two queries to get one result set. The issue is, I return no data when I combine them into one query. I have listed both queries, as well as the 3rd query that shows them combined.

    **Max Date/Time Query-Finds the most recent updated record based on the time and date (Correct Results Returned)
    SELECT [Yard Panel Number].panelNumber, Max([Yard Location].locDate) AS MaxOflocDate, Max([Yard Location].completionTime) AS MaxOfcompletionTime, [Yard Panel Number].jobNumber, [Yard Location].panelID
    FROM [Yard Panel Number], [Yard Location]
    WHERE ((([Yard Panel Number].panelID)=[Yard Location].[panelID]))
    GROUP BY [Yard Panel Number].panelNumber, [Yard Panel Number].jobNumber, [Yard Location].panelID
    ORDER BY [Yard Panel Number].panelNumber;

    **From To Query--Finds all record locations (Correct Results Returned)
    SELECT [Project Information].jobName, [Project Information].jobNumber, [Yard Location].locationFrom, [Yard Location].locationTo, [Yard Location].panelID, [Yard Location].damage


    FROM [Project Information], [Yard Location]
    WHERE ((([Project Information].[jobNumber])=[Yard Location].[jobNumber]));

    **Finally, Query1--Combines above queries, to find the most recent record of locations, based on the most recent date and time. When I run this query I return NO results
    SELECT DISTINCT [FromTo Query].jobName, [FromTo Query].jobNumber, [Max Date/Time Query].panelNumber, [Max Date/Time Query].MaxOflocDate, [Max Date/Time Query].MaxOfcompletionTime, [FromTo Query].locationFrom, [FromTo Query].locationTo
    FROM [Max Date/Time Query], [FromTo Query]
    WHERE ((([FromTo Query].[paneID])=[Max Date/Time Query].[panelID]))
    AND ((([FromTo Query].[jobNumber])=[Max Date/Time Query].[jobNumber]));

    I can't figure it out, Please advise!

    Any assistance is appreciated. :?

  2. #2
    Ryan is offline Novice
    Windows Vista Access 2003
    Join Date
    Aug 2009
    Location
    Lafayette LA 70592
    Posts
    26

    Post Union Query

    To Combine two querys, the One that combines them must be a Union Query.

    Microsoft has a page on how to create this:

    http://office.microsoft.com/en-us/ac...061091033.aspx

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

Similar Threads

  1. Help me please w/ combining like customers
    By lsulaurie in forum Queries
    Replies: 2
    Last Post: 06-30-2008, 02:59 PM
  2. Combining like update queries
    By xcr800man in forum Queries
    Replies: 2
    Last Post: 05-20-2008, 08:36 AM
  3. Replies: 1
    Last Post: 06-21-2007, 01:02 PM
  4. Combining Databases
    By RHall in forum Access
    Replies: 2
    Last Post: 04-13-2006, 07:36 AM
  5. Help combining 3 tables
    By luscioussarita in forum Queries
    Replies: 1
    Last Post: 12-14-2005, 03:22 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