Skip to Content
0

How to query the average shelf time of sold goods

Jul 12, 2017 at 09:54 AM

42

avatar image
Former Member

Based on invoices, I want to know how long the products have been in inventory before sold. Any SQL suggestions for this?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Nagarajan K Jul 15, 2017 at 02:22 PM
0

Hi,

Try this query,

SELECT T0.[ItemCode], T0.[Dscription], max(T0.[DocDate]) as 'Last Received Date' FROM OINM T0 WHERE T0.[OutQty] <= 0 GROUP BY T0.[ItemCode], T0.[Dscription] ORDER BY max(T0.[DocDate]) desc

Regards,

Nagarajan

Share
10 |10000 characters needed characters left characters exceeded