X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
   Reply to this topicStart new topic
> Subtract The Previous Vale From The Current Value, Access 2007    
post Mar 26 2020, 10:47 AM

Posts: 1
Joined: 26-March 20

I have a table with readings from the gauge of a diesel engine ( unit=hours). How do I continuously subtract the previous reading from the current reading in a query to get the hours between the readings?

The reading in ID1 (8006) must be subtracted from ID2 (8023) to give me an answer of 17, the next record will be 7, then 14 etc.

ID Date Reading Result
1 10-Jan-20 8006 0
2 14-Jan-20 8023 17
3 15-Jan-20 8030 7
4 16-Jan-20 8044 14

Pardon the elementary question but any help will be apreciated.

Go to the top of the page
post Mar 26 2020, 11:02 AM

UA Moderator
Posts: 78,121
Joined: 19-June 07
From: SunnySandyEggo

Hi. Welcome to UtterAccess! welcome2UA.gif

You can use a subquery or DLookup() to get the value from a previous record. Take a look here for some explanation.

Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page

Custom Search

RSSSearch   Top   Lo-Fi    30th May 2020 - 10:09 AM