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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subtract number from previous days number

Status
Not open for further replies.

cbiker

Programmer
Jul 2, 2003
35
US
I have an qry that brings up one months worth of flow meter numbers. what i would like to do is subtract the previouse days flow meter number from each days number to get a flow for the day. I tryed Dlookup but couldnt et it to work. any help would be appritiated.
 
Something along the lines of
[blue][tt]
Select T.TheDate As [Reading Date],

T.MeterReading As [Reading],

(T.MeterReading -

(Select MAX(MeterReading) From tbl As X
Where X.TheDate < T.TheDate )) As [Flow]

From tbl As T
[/tt][/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top