Help on query logic

G

Guest

Can someone suggest some logic for the following:

I have two tables: one gives a listing of items and the
second gives a listing of transactions performed on these
items. I want to select particular items from the first
table, then select a transaction performed on this item
from the second table. This part I can do.

What I need to do is then also select the next transaction
performed on that same item.

These are linked Oracle tables using Access 2000.

Thanks for any help or guidance!
 
M

[MVP] S.Clark

The question for you is, what does it mean to be "Next"? Is it a sequential
number, a date time combo, or some other value.

If the "previous" is 8 and the next something greater than 8, then you could
retrieve the next record higher than 8:

Select Top 1 fieldname from tablename WHERE somefield > 8 Order by fieldname
DESC

Obviously, this requires some coding as the 8 would need to be replaced with
a value dynamically.
 
Top