Using a function to navigate records

J

Jake Frankham

Hi

I have opened a query in code

The query has 2 fields, [ID] and [weeks] (+ others that are irrelevant)

thus:

2233123 5
2233123 4
2233123 8
1556677 4
1556677 3

I need to navigate through the whole query and FOR EACH [ID] I need to
return the record which has the number 4

So in the example above I wish only to return the 2nd and 4th records.

Any ideas

Many thanks

Jake
 
J

Jeff Boyce

Jake

It isn't clear from your description if you are running an existing query
and doing so from a code module, or are creating a SQL statement in a module
and running it as a "query".

If the former, modify the query to select only those rows with [weeks] = 4.
If the latter, add a WHERE clause to the SQL statement to limit to only
those rows with [weeks] = 4.
 
Top