we are trying to build an inventory aging report o...
# suiteql
s
we are trying to build an inventory aging report of any item that has been received into our main location more then 90 days ago and still has stock available this is version 1 but it has a major flaw if i received an item 365 days ago and received it today it will show up
Copy code
SELECT 
(SELECT name FROM customlist259 WHERE Item.custitem2 = id )AS  MAN,
item.itemid,
item.description,
inventoryItemLocations.quantityavailable,
transactionLine.rate,
'$ ' || ROUND(inventoryItemLocations.quantityavailable * transactionLine.rate,2)  AS VALUE ,


            FROM transactionLine
            INNER JOIN Transaction ON
             TransactionLine.Transaction = Transaction.ID 
             INNER JOIN item ON 
             transactionLine.item = item.id
           LEFT JOIN inventoryItemLocations ON item.id = inventoryItemLocations.item AND inventoryItemLocations.location IN (14)

             WHERE
             Transaction.type = 'ItemRcpt'
            AND transaction.trandate BETWEEN TO_DATE('2023-01-01', 'YYYY-MM-DD') AND SYSDATE - 90
            AND Transaction.createdby = 70 
             AND  transactionLine.location IN (14,3)
      AND transactionLine.isinventoryaffecting  = 'T'
     AND inventoryItemLocations.quantityavailable >  3
             ORDER BY man