Hi Dan,

>      I think I have now found a way, but it involves an extra "step" 
> (actually an extra query). Create a table with the following fields: 
> FuelID (PK), Date, FuelCost, FuelQuanity, and Odometer. Then create a 
> query (Query1) with these fields from the table: FuelID, FuelQuanity, 
> and Odometer. Create a second query (Query2). Its fields are: 
> Fuel.Date, Fuel.FuelCost, Query1.FuelQuanity, 
> (Query1.Odometer-Fuel.Odometer)/Query1.FuelQuanity, and 
> Query1.FuelID-Fuel.FuelID. Set two Criterion: Query1.FuelID - 
> Fuel.FuelID = 1; and 
> (Query1.Odometer-Fuel.Odometer)/Query1.FuelQuanity >0. 
>      I can now use information from two consecutive rows to make 
> calculations.

Pretty cool!

> Granted, anyone entering information in the 
> wrong sequence will also get erroneous results. But, isn't that where 
> the expression garbage in garbage out applies?

At this point, I disagree. As said, from a theoritical point of view,
the order of rows in a table is in no way reliable, and might be changed
by the underlying database engine any time. So, relying on the "order of
entering data" being the "order of returning data" is, *strictly*
speaking, plain wrong.

But, as Andrew said, that's the theory only. Practice says your approach
works. Thanks for sharing it, I like it (for practical purpose :)

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Base                       http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to