Correlated SubQueries in Access

N

News.Microsoft.com

I know that Access does not support correlated subqueries so how can I make
this work?

update (emplsite inner join member on emplsite.employerno =
member.employerno
and emplsite.jobsite = member.jobsite) set emplsite.nummembers = (select
count(socsecno) from member )

Thanks
Bill
 
J

John Vinson

I know that Access does not support correlated subqueries so how can I make
this work?

And what makes you think Access doesn't support correlated
subqueries!? I use them often and they work fine. What you CAN'T do is
use a Count or any other Totals operator in an update query - even if,
as in this case, it should logically do so.

If you want to (redundantly, erroneously, and unwisely) store the
count of members sharing the employerno and jobsite into the
nummembers field, try using the DCount() function:

UPDATE Emplsite
SET emplsite.nummembers =
DCount("[socsecno]", "member",
"[employerno] = " & [employerno]
& " AND [jobsite] = '" & [jobsite] & "'")

Assuming that employerno is Number and jobsite is Text.

John W. Vinson[MVP]
 

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

Top