Results 1 to 2 of 2
  1. #1
    Richard_Marx is offline Advanced Beginner
    Windows 7 32bit Access 2000
    Join Date
    Jul 2013
    Posts
    36

    Query Off of another Query

    I have 3 query's with the syntax below:


    Query1
    Code:
    SELECT COUNT(ID) As CountOfID
    FROM table1
    WHERE saleDate BETWEEN [forms]![form1]![begin] AND [forms]![form1]![end]
    Query2
    Code:
    SELECT COUNT(ID) AS COUNTOFID
    FROM table2
    WHERE saleDate BETWEEN [forms]![form1]![begin] AND [forms]![form1]![end]
    Query3
    Code:
    SELECT [table1].[CountOfID]+[table2].[CountOfID]
    FROM table1, table2

    I want to run query3 from the push button on a form, and it display accurate data, but when I run query 3 it displays '0' when that is incorrect. How should I set this up?

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You need to have Query1 and Query2 in Query3, NOT table1 and table2.

    It would look something like
    Code:
    SELECT [Query1].[CountOfID] + [Query2].[CountOfID] AS total
    FROM Query1, Query2

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

Similar Threads

  1. Replies: 7
    Last Post: 07-11-2013, 10:45 AM
  2. Replies: 3
    Last Post: 10-17-2012, 09:24 AM
  3. Replies: 8
    Last Post: 05-16-2012, 09:30 AM
  4. Replies: 7
    Last Post: 05-02-2012, 08:04 AM
  5. Replies: 1
    Last Post: 07-30-2010, 10:28 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
  •  
Other Forums: Microsoft Office Forums