J.J. This should work : SELECT tblPeriods.Period, tblOrders.Item, Sum(tblOrders.Units) AS SumOfUnits FROM tblOrders, tblPeriods WHERE (((tblOrders.DueDate) Between [tblPeriods].[StartDate] And [tblPeriods].[EndDate])) GROUP BY tblPeriods.Period, tblOrders.Item;
On 9/20/05, soccercoachjj <[EMAIL PROTECTED]> wrote: > > I need some help writing a query to group some data by a date range. > I have an order table with three fields: item number, quantity, and > due date. I have another table with three fields: period, start date > and end date. What I'm trying to do is summarize the quantity of an > item by period. > > As an example: If item "A" has orders for 100 units each with due > dates of 9/22/05, 9/23/05 and 9/28/05. The period table defines > period 1 as beginning 8/27/05 and ending 9/24/05, period 2 beginning > 9/25/05 and ending 10/29/05. I'm trying to write a query which tells > me that I have orders for 200 of item A in period 1 and 100 of item A > in period 2. > > I'm not familiar with how to pull this information where the detail of > my order records falls within a date range defined by the records in > my period table. Any help would be greatly appreciated. > > Thanks, > J.J. > > > > > > > > > > > Yahoo! Groups Links > > > > > > > -- Eddie [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/q7folB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/ms_access/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
