Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting Problem

Status
Not open for further replies.

cherrielwy

IS-IT--Management
Jul 30, 2003
27
MY
HI,

I have a database that will store the data of Quantity Stock that will be add dairly and also Quantity Stock that will be withdraw dairly. I need to know the update quqntity of stock in the store,so i using the query to count for it. [TotalStock]=[SumOfQuantityAdd]-[SumOfQuantityWithdraw]. The problem is if i haven't withraw the stock before,the quantity stock in store cannot be counted,so i cannot show the quantity in store in my report.How can i solve the problem?Any suggestion?Thank You


Cherrie


 
In your equation you can make the following change:

[TotalStock] = (Iif(IsNull([SumOfQuantityAdd]),0,[SumOfQuantityAdd]))-(Iif(IsNull([SumOfQuantityWithdraw]),0,[SumOfQuantityWithdraw]))

This will allow you to check of the quantity withdrawn or added is null and replace it with a zero if that is the case to allow the calculation to process correctly.

DBAMJA

It is said that God will give you no more than you can handle. I just wish God didn't have so much faith in me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top