Dear All,

I have a small database which has two tables, table A = Stock and table B = Sold, these both has same fields including quantity,

I have all my items in stock table, but what I want to do is when I sold something and entered in sold item so that Item should be deducted from the stock, Exp, I have Dell Laptop and many others laptops in my stock table, but when I sold one laptop and entered that in sold item so the exact item should be deducted not rest.

Your assistance would be helpful to me and I would be thankful of you all.

thanks
Sayed Amin

I'd say you need to do some normalisation on your data model. You should not be using two tables. Personally I would simply have a sold date in the stock table. When the sold date is null then the item is still in stock.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.