Skip to Content
avatar image
Former Member

QUERY FOR INVENTORY BEGINNING BALANCE PER MONTH

Hi Experts,

I really like to see a report that can generate a inventory beginning balance per month

like this.

Item Code | Item Discretion | Begining Balance Date | Quantity | Ending Balance Date | Quantity

Thank You Very much.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jan 30, 2017 at 06:15 AM

    Hi,

    Pls try this and revert back..

    SELECT distinct T0.ITEMCODE , T1.FrgnName as 'Part No', T1.ItemName, T2.ItmsGrpNam, T0.WhsCode, T0.ONHAND as 'Total Qty', T0.ONHAND*T0.AVGPRICE as 'TotalPrice' ,T1.[ManBtchNum], T1.[ManSerNum],
    CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 30 THEN T0.ONHAND END '>30 Days(Qty)',
    CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 30THEN T0.ONHAND*T0.AVGPRICE END '>30 Days(Value)',
    CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 60 THEN T0.ONHAND END '>60 Days(Qty)',
    CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 60THEN T0.ONHAND*T0.AVGPRICE END '>60 Days(Value)',
    CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 90 THEN T0.ONHAND END '>90 Days(Qty)',
    CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 90THEN T0.ONHAND*T0.AVGPRICE END '>90 Days(Value)',
    CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 180 THEN T0.ONHAND END '>180 Days(Qty)',
    CASE WHEN Datediff(day, T1.LASTPURDAT,GETDATE()) >= 180 THEN T0.ONHAND*T0.AVGPRICE END '>180 Days(Value)'
    FROM OITW T0 INNER JOIN OITM T1 ON T0.ITEMCODE = T1.ITEMCODE
    INNER JOIN OITB T2 ON T1.ITMSGRPCOD=T2.ITMSGRPCOD left join ibt1 t3 on t3.itemcode = t0.itemcode and t3.whscode = t0.whscode
    WHERE
    T0.ONHAND>0 AND (T0.WhsCode ='[%0]' or '[%0]' = '') and (T2.ItmsGrpNam = '[%1]' or '[%1]' = '')

    Add comment
    10|10000 characters needed characters exceeded