PDA

View Full Version : Comparing total stock capacity available per day against stock sold each day.


bazz
07-07-2005, 04:05 PM
Me again, :o

OK so I have a FFDb which lists the total stick capacity per day. What I need to do at the time of each purchase, is to check the maximum available stock, against the amount sold that day.
Would this be better done with two FFDb's, one for available stock and the other for stock sold - the difference between the two. Couldn't each new purchase, do the comparison and then amend the 2nd FFDb to show that another purchase has been made?

Or perhaps there's a better way?

Any suggestions would be most welcome.

Bazz

mlseim
07-07-2005, 04:14 PM
I'm thinking 1 FFDB with several fields, one of the fields being a flag that determines if it's the first activity of the day. It sounds like you need to refresh your available stock at the beginning of each day. So, if it's a new day and the first person buys something, the refresh takes place and the flag is changed so you will then keep a tally going throughout that day. A 2nd FFDB might be good for keeping a record of the refresh amounts, like an archive.

It will be important to make sure two people won't be accessing it at the same time with some file locking stuff.

The part about "sold that day" seems like it might be important to you?