Results 1 to 6 of 6
  1. #1
    lynnmc26 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2011
    Posts
    18

    Two Queries for One Report

    I have two complex queries that I need in one report.

    There is a parameter to input the date for the box history query however when I put both queries in a report the parameter appears the same number of times there is an entry - ie - asks me for the date 4 times if there are four items in the box history.



    What can I do to make the parameter appear just once?

    Here are the two queries

    #1:
    SELECT FOLDERS.IMBOXNO, FOLDERS.FILENO, BOXES.ACCOUNTCODE, FOLDERHISTORYTRACKING.REQUESTOR, FOLDERHISTORYTRACKING.REQUESTORLOCATION, FOLDERHISTORYTRACKING.DATEOUTCLIENT
    FROM (BOXES INNER JOIN FOLDERS ON BOXES.IMBOXNO = FOLDERS.IMBOXNO) INNER JOIN FOLDERHISTORYTRACKING ON FOLDERS.FOLDERID = FOLDERHISTORYTRACKING.FOLDERID
    WHERE (((FOLDERHISTORYTRACKING.REQUESTOR) Not Like 'COE' And (FOLDERHISTORYTRACKING.REQUESTOR) Is Not Null) AND ((FOLDERHISTORYTRACKING.REQUESTORLOCATION) Like '2') AND ((FOLDERHISTORYTRACKING.DATERETURNED) Is Null) AND ((TimeValue([FOLDERHISTORYTRACKING].[DATEOUTCLIENT])) Between #12/30/1899 10:5:1# And #12/30/1899 14:0:1#) AND ((FOLDERHISTORYTRACKING.RUSHDELIVERY)=No) AND ((DateValue([FOLDERHISTORYTRACKING].[DATEOUTCLIENT]))=Date()));

    #2:
    SELECT BOXES.IMBOXNO, BOXES.ACCOUNTCODE, BOXES.ADDITIONALBOXNO, BOXHISTORYTRACKING.REQUESTOR, BOXHISTORYTRACKING.REQUESTORLOCATION, BOXHISTORYTRACKING.DATEOUTCLIENT
    FROM BOXES INNER JOIN BOXHISTORYTRACKING ON BOXES.IMBOXNO = BOXHISTORYTRACKING.IMBOXNO
    WHERE (((BOXHISTORYTRACKING.REQUESTOR) Not Like 'COE' And (BOXHISTORYTRACKING.REQUESTOR) Is Not Null) AND ((BOXHISTORYTRACKING.REQUESTORLOCATION) Like '1') AND ((BOXHISTORYTRACKING.DATEOUTCLIENT)=[ENTER DATE OUT - eg - mm/dd/yyyy]) AND ((BOXHISTORYTRACKING.RUSHDELIVERY)=No) AND ((TimeValue([BOXHISTORYTRACKING].[PROCESSDATE])) Between #12/30/1899 10:5:1# And #12/30/1899 14:0:1#));

    Let me know if you have any questions.

    Thanks!
    Lynn

  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,963
    How does a report have two queries. Is this a report/subreport arrangement?

    Have user input date to a control on a form. Have the queries refer to the control as the input parameter.
    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
    lynnmc26 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2011
    Posts
    18
    The report is like a shipping manifest
    I insert each query into the body of the report
    One (box query) has a paramater to ask for a date.

    I can't do the control on the form for this to work.

    Any other suggestions?

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    It sounds to me like you're using more than 2 queries. The two queries you're listing are showing the data, but what's the data source for the report itself. If you just have a sheet with two sub reports you shoudn't be prompted multiple times unless you've also got a data source for the main report.

  5. #5
    lynnmc26 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2011
    Posts
    18
    I know - that is what I thought - I have a blank (new) report set up with a page header and dropped the two queries into the report as individual sub reports.

  6. #6
    lynnmc26 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2011
    Posts
    18
    I think I have solved this - redoing my report once again and it seems to be working.

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

Similar Threads

  1. Two queries in one report
    By victor in forum Programming
    Replies: 1
    Last Post: 08-05-2010, 01:31 AM
  2. Replies: 1
    Last Post: 06-29-2010, 03:40 AM
  3. Merging 3 queries into one report
    By terricritch in forum Reports
    Replies: 2
    Last Post: 06-23-2010, 02:38 AM
  4. Replies: 3
    Last Post: 05-21-2010, 03:57 PM
  5. Making report from 2 queries
    By QueeN in forum Reports
    Replies: 1
    Last Post: 04-20-2009, 01:36 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