I need a query that gets the first and last date for each item.
Items are brought into stock in an on going basis. Need to find the first day and last day an item was bought in.
What this does is show the same date for all three
[LastOfArrivalDelShip Date], [FirstOfArrivalDelShip Date], [ArrivalDelShip Date]
Here is what I have so far.
DougP
< I Built one
Items are brought into stock in an on going basis. Need to find the first day and last day an item was bought in.
What this does is show the same date for all three
[LastOfArrivalDelShip Date], [FirstOfArrivalDelShip Date], [ArrivalDelShip Date]
Here is what I have so far.
Code:
SELECT [Available to Promise].Item, Sum([Available to Promise].Quantity) AS SumOfQuantity, [Available to Promise].Warehouse, [Available to Promise].[ArrivalDelShip Date], Last([Available to Promise].[ArrivalDelShip Date]) AS [LastOfArrivalDelShip Date], First([Available to Promise].[ArrivalDelShip Date]) AS [FirstOfArrivalDelShip Date]
FROM [Available to Promise]
GROUP BY [Available to Promise].Item, [Available to Promise].Warehouse, [Available to Promise].[ArrivalDelShip Date];
DougP
![[r2d2] [r2d2] [r2d2]](/data/assets/smilies/r2d2.gif)