Results 1 to 2 of 2
  1. #1
    klnlsu is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    107

    Using a query in a query

    Order Header Table Order Detail Table
    Order Number INNER JOIN Order Number
    Customer ID GROUP BY
    Item Number GROUP BY
    Invoice Date MAX (latest)
    Invoice Number Individual record
    Quantity Individual record
    Price Individual record
    Unit of Measure Individual record
    Discount Percent Individual record


    I have created a query (without aggregation) using the two tables above. My objective is to find out the last time each item number was purchased by a customer based on order history. I want to GROUP BY Customer ID and Item Number, find the last date that the item was purchased, and then pull the remaining information in from the record that was selected. This initially seemed pretty easy, but I soon found out it is more difficult than I expected. I think I need to use a subquery in a query, but I'm having trouble figuring out the logical steps and the syntax. I want to use this query for a Customer Item Report and again for a Customer Item Enter/Edit Form. Can someone help?

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936

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

Similar Threads

  1. Replies: 6
    Last Post: 08-05-2016, 10:57 PM
  2. Replies: 3
    Last Post: 01-15-2016, 02:35 PM
  3. Replies: 2
    Last Post: 04-07-2015, 04:54 PM
  4. Best Practise Query a Query or Query a Table
    By Derrick T. Davidson in forum Access
    Replies: 4
    Last Post: 07-29-2014, 10:18 AM
  5. Replies: 7
    Last Post: 07-11-2013, 10:45 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