Quantcast
Viewing all articles
Browse latest Browse all 3145

Query to show Items in FIFO method.

Dear Experts,my client needs a report which shows inventory data.he executes this report before every sale and checks the Item availability.we should show the report in FIFO method.Sl.No. Itemcode Qty Price DocType DocNum Date Trans.No. (Varchar(10)) (Numeric) Numeric(19,6) Varchar(10) Varchar(10) (Date) (integer) 1 IT001 10 100 PURCHASE 210000033 2013-09-11 85 2 IT002 10 1000 PURCHASE 210000033 2013-09-11 85 3 IT001 5 200 SALES 110000019 2013-09-11 86 4 IT001 5 200 PURCHASE 210000034 2013-09-11 87here in the above table i have data.if user executes the report, it should show report as below from the data above.-------------------------------------------------Sl.No Itemcode Available Qty. Price -------------------------------------------------1 IT001 5 100 ------5 Qty is sold as shown in above table at line 3.2 IT002 10 1000 3 IT001 5 200 ------5 Qty is Purchased at line 3. it is shown in different line ------------------------------------------------- because different price (FIFO method). I thought of using self Join the first table....but ended up with wrong data.Help appreciated in this regard.Thank youKishore.

Viewing all articles
Browse latest Browse all 3145

Trending Articles