SQL View – Inventory Receipts
The following view returns the results from IV10200 inventory receipts table. This will show you every time you have received an item and at what costs.
This view is also a modification of the spvInventoryReceipts view from Salespad (www.salespad.net).
You can name the view whatever you want by change the [tspvInventoryReceipts] below. Also the USE [TSP] tells the script to only execute on my database named TSP. You will need to modify the [TSP] to be whatever your database name is.
/****** Object: View [dbo].[tspvInventoryReceipts] Script Date: 03/29/2010 17:29:41 ******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE view [dbo].[tspvInventoryReceipts]
from iv10200 a
If you want to view your FIFO/LIFO inventory costs, then add the following where clause to the end of the above query:
ORDER BY Item_Number, Date_Received
ORDER BY Item_Number, Date_Received DESC
The results will be ordered by your FIFO or LIFO quantities depending on the clause you choose.
Update (4/6/2010): It has been brought to my attention that my FIFO/LIFO clauses were exactly the same. I have added a DESC to the LIFO clause ORDER BY statement to order the results of the received by the newest first (LIFO). Thanks David!