B
BenHuge
Hello All and thanks in advance for any help you can provide,
I am trying to create a query that grabs the ten most recent deliveries by
part number and then sum the number of items delivered in an inventory db
that I am creating. There are a few different tables linked by part number
and delivery with a date associated with each delivery. There are a few
hundred part numbers and I wanted to avoid creating a table for every part
number just to grab the ten most recent deliveries if that makes sense.
Here is the SQL for the table that sorts and counts the deliveries by part
number and it sums the number delivered by part number. It counts all of the
records and I need it to count just the ten most recent.
SELECT DISTINCTROW [Past Deliveries].[Part Number], Sum([Past
Deliveries].[Number Delivered]) AS [Sum Of Number Delivered], Count(*) AS
[Count Of Past Deliveries]
FROM [Past Deliveries]
GROUP BY [Past Deliveries].[Part Number];
I am trying to create a query that grabs the ten most recent deliveries by
part number and then sum the number of items delivered in an inventory db
that I am creating. There are a few different tables linked by part number
and delivery with a date associated with each delivery. There are a few
hundred part numbers and I wanted to avoid creating a table for every part
number just to grab the ten most recent deliveries if that makes sense.
Here is the SQL for the table that sorts and counts the deliveries by part
number and it sums the number delivered by part number. It counts all of the
records and I need it to count just the ten most recent.
SELECT DISTINCTROW [Past Deliveries].[Part Number], Sum([Past
Deliveries].[Number Delivered]) AS [Sum Of Number Delivered], Count(*) AS
[Count Of Past Deliveries]
FROM [Past Deliveries]
GROUP BY [Past Deliveries].[Part Number];