Skip to Content
avatar image
Former Member

How to query the average shelf time of sold goods

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jul 15, 2017 at 02:22 PM

    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

    Add comment
    10|10000 characters needed characters exceeded