[AccessD] Using IN (SELECT SQL STATEMENT)

John Colby jwcolby at ColbyConsulting.com
Wed Dec 21 11:00:04 CST 2005


I have a situation where I need to be able to update just a subset of
records in a table - where the PK of those records appear in another table.
I created a query to pull a DISTINCT set of those IDs, saved the query and
then joined my existing query to that new query.  Doing this made the query
non-updatable. By using an IN() in the where clause under the ID that I was
trying to join on, the query became updateable again.

In other words, instead of an inner join between DOC_ID and the matching
field in qselDocIDIntblSystemDocument, I used a where clause:

WHERE (((tblDocuments.DOC_ID) In (SELECT SD_IDDOC FROM
qselDocIDIntblSystemDocument)));

I have had this issue (a join causes a non-updateable query) in the past and
never really solved it.  I think this is going to solve that problem for me.

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/




More information about the AccessD mailing list