jostrep
05-19-2002, 11:51 AM
Can someone please help me i have the following problem.
Each day we are entrering the value of a totaliser (for total flow).The old system use excell no problem here. But in access we are storing the values in a table but i cant find any information on how to calculate the difference today's and yesterday's values witch represent the daily flow.
Any ideas?
Thanks
llkhoutx
05-20-2002, 09:57 PM
Just subtract them. If there's a time component in you date field, you'll get erroneous answers. Therefore, make sure your dates are dates, and nothing more.
jostrep
05-21-2002, 11:43 AM
But how do i do that when the value i must substract is from the previous day?
Thx
Do you have a sequential PK field?
jostrep
05-21-2002, 08:12 PM
what is is a pk field?
the field type is numerical
For each record you've got the date and the totaliser value for that day. What i need to do is calculate the difference between that day's value and the previous one.
David R
05-28-2002, 01:13 PM
If you're still looking for the answer to this one:
You'll need a way to get the value from both records and calculate it with VBA. Check out the PrevRecVal function, Rich has posted it before.
Or, there's a funky way to do it with a series of queries, but VBA is probably faster/more efficient.
[This message has been edited by David R (edited 05-28-2002).]
Maybe you can find something here:
http://www.access-programmers.co.uk/ubb/Forum1/HTML/008407.html
Fuga.
jostrep
05-28-2002, 06:31 PM
Thanx a lot actually i think i got another way to do it with queries and will let the board know if it works. But its sure is nice to have a backup plan