Can I do a query within a query?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is a question for Access 2000.

I need to search a large table to find specific records (the criteria will
be a date) then once these records are identified I need to update a field in
a related record within the same table (I will be able to identify the
related record through a small calculation which will give me a way to
identify it).

So in short:
-Identify Records that meet criteria (can be many records)
-For each record that meets criteria, update a related record within the
same table.

Identifing the records is the easy part but how do I update the related
records easily. Can I do a query within a query?

I have thought of a rather lengthy way to do it but I just cannot think of
an easy way to do this. I used to be pretty good with Access and VBA but have
been away from it for a few years and it is coming back slowly. I feel sure I
am missing a somewhat easy solution.

Any advice would be appreciated.
Thanks
 
I would do this in two queries, one to identify the records to be updated
(SELECT query) and the second to do the actual update (UPDATE query). The
second query uses the first as input. Yes, you can do a query within a query
but its not always more efficient to do it that way. After you have done
this, you may be able to figure out a way to combine the two queries into one.

Dorian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top