468,170 Members | 1,923 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,170 developers. It's quick & easy.

Filtering records in a query based on field values in adjacent records

I'm looking for a way to filter records in a query (or report) based on
a value in a field of an adjacent record. Can this be done easily? I
cannot find any info in the help files.

Thanks

May 26 '06 #1
3 1825
"sdisalvo" <sd******@earthlink.net> wrote in
news:11**********************@j55g2000cwa.googlegr oups.com:
I'm looking for a way to filter records in a query (or report)
based on a value in a field of an adjacent record. Can this be
done easily? I cannot find any info in the help files.

Thanks

Adjacent is ephemeral. What is the criteria that makes the records
adjacent? a date? a sequence number? If you have an autonumber for
example, the adjacent record will probably have the next higher or
lower number. When we know what makes a record adjacent, we may be
able to find a solution. But not before.
..
--
Bob Quintal

PA is y I've altered my email address.
May 26 '06 #2
Sorry about that. There is an autonumber field in the table that would
work for me.

May 26 '06 #3
"sdisalvo" <sd******@earthlink.net> wrote in
news:11*********************@y43g2000cwc.googlegro ups.com:
Sorry about that. There is an autonumber field in the table
that would work for me.


You could create a query that uses two copies of your table with
the autonumber of the second instance filtered to be equal to the
first instances autonumber +1

untested, but should work.

SELECT a.* from mytable as a, mytable as b
WHERE b.autonum = a.autonum+1
and b.filterfield = "some value"
;
--
Bob Quintal

PA is y I've altered my email address.
May 26 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Sean | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by kamranasdasdas | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.