Dear Bytes Users
I have created a database for fuel consumption for various vehicles. By entering the date, plantno, mileage_reading and liter. I managed to get the previous mileage_reading via a select statement in query:
- created a query from a table fuelbook and made an alias fuelbook1
- created a new field
Prevmeter: (Select max(meter) from fuelbook Where meter < fuelbook1.[meter] and plantno = fuelbook1.[plantno])
Till there is works perfect and I can retrieve the previous data for the meter reading
Now I am trying to retrieve the previous liter which is depending on previous record, with the same plantno.
I tried it with Dlookup were I can get the previous record but not for the specific plantno, it give only the liter previous ID (as I used ID-1)
I tried also
Prevliter: (Select (liter) from fuelbook Where liter < fuelbook1.[liter] and plantno = fuelbook1.[plantno])
But this gives no result
Anybody who can get me in the right direction
I have created a database for fuel consumption for various vehicles. By entering the date, plantno, mileage_reading and liter. I managed to get the previous mileage_reading via a select statement in query:
- created a query from a table fuelbook and made an alias fuelbook1
- created a new field
Prevmeter: (Select max(meter) from fuelbook Where meter < fuelbook1.[meter] and plantno = fuelbook1.[plantno])
Till there is works perfect and I can retrieve the previous data for the meter reading
Now I am trying to retrieve the previous liter which is depending on previous record, with the same plantno.
I tried it with Dlookup were I can get the previous record but not for the specific plantno, it give only the liter previous ID (as I used ID-1)
I tried also
Prevliter: (Select (liter) from fuelbook Where liter < fuelbook1.[liter] and plantno = fuelbook1.[plantno])
But this gives no result
Anybody who can get me in the right direction
Comment