Quote Originally Posted by weifuk
Hi All,

I developed an inventory system, with a product table which records quantity in stock.

However, my friends told me yesterday that it is better to store InitialStock, and make a query to view available stock instead.

Which is best? What are the pros and cons?

Thank you!
I would personally create a DEBIT/CREDIT type table.

The first entry for an item would be a CREDIT entry (type code="C") and have the initial stock amount as the value.

It would structure the table something like:

ITEM CODE
TRANSACTION DATE
TRANSACTION TYPE (C or D)
AMOUNT

You could always add a TRANSACTION SEQ if you expect more than one ITEM CODE/TRANSACTION DATE activity to occur on the same day.

Each time stock is reduced, a TYPE=D entry is loaded.