Question Difficult problem (1 Viewer)

oliver916

Registered User.
Local time
Today, 16:22
Joined
Nov 24, 2009
Messages
32
hi all
i have a complicated problem that i didn't know even in witch section i have to mention it!

I'm designing database that calculate diesel consumption at the my company
in this database i have:
Diesel income (from supplier)
Diesel outgo (to the vehicles & machinery)
what i want is how to make a table or queries or .......
that calculate opening balance for diesel & closing balance for diesel at each day by
(diesel income & diesel outgo)
when the closing balance is the opening balance for the next day

my database it attached
 

Attachments

  • Diesel.zip
    1 MB · Views: 97

oliver916

Registered User.
Local time
Today, 16:22
Joined
Nov 24, 2009
Messages
32
thanks for the link
more help if possible
i couldn't figure it right
 

GinaWhipp

AWF VIP
Local time
Today, 08:22
Joined
Jun 21, 2011
Messages
5,899
You did not say what you couldn't figure out. The example posted shows how to get Quantity On Hand which in your case would be Current Amount. As this amount is a calcualted amount t would have the current amount everytime the query is run.

The only other things that come to mind...

1. See...
http://support.microsoft.com/default.aspx?scid=kb;en-us;101081

2. The only other thing that comes to mind is, create a query that gives you a Running Sum and then another query to pull that ending balance.
 

oliver916

Registered User.
Local time
Today, 16:22
Joined
Nov 24, 2009
Messages
32
2. The only other thing that comes to mind is, create a query that gives you a Running Sum and then another query to pull that ending balance.
Here is my problem
i couldn't do it till now
 

MarkK

bit cruncher
Local time
Today, 05:22
Joined
Mar 17, 2004
Messages
8,181
Don't create a new entry for opening and closing balances.
Record FuelIn and FuelOut and date/time for these events. Then, the balance of fuel on hand at any moment in time is the sum of all fuel transactions before that time.
Balance is not number you store, but always a number you calculate based on the latest deposits and withdrawals.
Cheers,
Mark
 

Users who are viewing this thread

Top Bottom