Results 1 to 3 of 3
  1. #1
    igendreau is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jul 2011
    Posts
    6

    Use a query parameter that isn't needed for grouping

    I have a query that shows some basic info on items we've shipped out: ProductID, ProductName, Quantity, Ship Date, etc...



    The goal is to pass a date range to the query so I can see "how many of each product was shipped from StartDate to EndDate". Everything works great, except that my products only group by identical rows. So if product #742 had multiple records, because it was shipped on different days, they don't group. I literally just need to pass a date range through and spit out:

    ProductID and Sum(Quantity)

    but only for the date range specified. How do I do this? Here's what the SQL looks like:

    SELECT History.ProductID, Sum(History.Quantity) AS SumOfQuantity, History.ProductName, History.Category, History.Description, History.Method, History.ShipDate
    FROM History
    GROUP BY History.ProductID, History.ProductName, History.Category, History.Description, History.Method, History.ShipDate
    HAVING (((History.Method)="Shipped") AND ((History.ShipDate) Between [Forms]![ReportsMenu]![txtStart3] And [Forms]![ReportsMenu]![txtEnd3]));

    Thanks!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Have Q1 to pull only product # in the date range.
    Have Q2 using Q1 and other table to pull all the data in the product#

  3. #3
    igendreau is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jul 2011
    Posts
    6
    Perfect. Thanks!

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

Similar Threads

  1. Parameter Query Help Needed
    By Lynnemcc87 in forum Access
    Replies: 9
    Last Post: 08-13-2014, 08:37 AM
  2. Query Grouping Help
    By athyeh in forum Queries
    Replies: 1
    Last Post: 04-15-2014, 09:38 AM
  3. Replies: 12
    Last Post: 06-25-2013, 12:52 PM
  4. HELP NEEDED! Enter Parameter Value
    By lpfluger in forum Queries
    Replies: 4
    Last Post: 03-27-2011, 04:38 PM
  5. Grouping query
    By Mphiri in forum Programming
    Replies: 10
    Last Post: 06-15-2010, 08:58 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