Results 1 to 3 of 3
  1. #1
    Rustin788 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Posts
    47

    Not Getting All Results

    Hey,

    I am trying to set up a query that will be able to show customers buying history. Currently I have it set up to show all of 2013, 6 months ago, 5months ago... down to the past month. My problem is I can not get it to show me all the records. When I run my final query (which pulls from a bunch of other queries) it gives me 223 results when the # of customers in that time period is actually in the 600 range. I have tried erasing all the table relationships in the query but that just resulted in a query that after 20 minutes still had not finished. I have started a separate query using SQL that allows me to pull all the customers from the other queries that looks like the first quote box below and it shows the customers that should be in the final result. In the final query the formula I have for each column is: Last Month: IIf([Total Cases 1 Month]![Total]=0,0,[Total Revenue 1 Month]![SumOfSumOfMerchandiseValue]/[Total Cases 1 Month]![Total])

    What can I do to get the final query to show me all the appropriate results.


    SELECT [Customer]
    FROM [Total Cases 2013]
    UNION SELECT [Customer]
    FROM [Total Revenue 2013];
    UNION SELECT [Customer]


    FROM [Total Cases 6 Months];
    UNION SELECT [Customer]
    FROM [Total Revenue 6 Months];
    UNION SELECT [Customer]
    FROM [Total Cases 5 Months];
    UNION SELECT [Customer]
    FROM [Total Revenue 5 Months];
    UNION SELECT [Customer]
    FROM [Total Cases 4 Months];
    UNION SELECT [Customer]
    FROM [Total Revenue 4 Months];
    UNION SELECT [Customer]
    FROM [Total Cases 3 Months];
    UNION SELECT [Customer]
    FROM [Total Revenue 3 Months];
    UNION SELECT [Customer]
    FROM [Total Cases 2 Months];
    UNION SELECT [Customer]
    FROM [Total Revenue 2 Months];
    UNION SELECT [Customer]
    FROM [Total Cases 1 Month];
    UNION SELECT [Customer]
    FROM [Total Revenue 1 Month];
    Thanks for any advise you can give.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    See this material from Martin Green regarding vba and sql and Dynamic Reports.

    You do not need all of the queries you have in my view.
    Good luck.

  3. #3
    Rustin788 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Mar 2014
    Posts
    47
    Thanks, I will take a look at that.

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

Similar Threads

  1. first three results
    By slimjen in forum Queries
    Replies: 2
    Last Post: 11-04-2013, 03:43 PM
  2. Replies: 5
    Last Post: 05-21-2013, 02:21 PM
  3. Replies: 3
    Last Post: 05-02-2013, 10:36 AM
  4. Use SQL results
    By NISMOJim in forum Programming
    Replies: 7
    Last Post: 10-05-2012, 03:10 AM
  5. Replies: 6
    Last Post: 05-14-2012, 07:24 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