We have a database that tracks inventory being used sort of like a rental database. the database is for events that users can order chairs, tables etc for the moving and event department to deliver. I need to get a query to show the sum of inventory for chairs for every date being delivered. I have a table such as below.
the main sql is below
SELECT Events.EventID, tblEventDetails.Quantity, Events.DeliveryDt, Events.EventEndDt, Events.EventStartDt, Events.EventEndDt, Events.PickupDt
FROM Events INNER JOIN tblEventDetails ON Events.EventID = tblEventDetails.EventID
WHERE (((tblEventDetails.ItemID)=23))
ORDER BY Events.EventID, Events.DeliveryDt;
Event Id 18624
Qty 14
DeliveryDt 6/29/2017
EventEndDt 8/1/2017
another record
Event id 19214
Qty 200
DeliveryDt 6/29/2017
EventEndDt 6/30/2017
so I am trying to break it down so that each date has a sum for the inventory type
how could I get a query (probably a crosstab) to show each date with the sum like below
6/29/2017 214
6/30/2017 214
7/1/2017 14
7/2/2014 14
etc
Thank you for any help.
Jim Wagner
Posted by: luvmymelody@yahoo.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (1) |
Tidak ada komentar:
Posting Komentar