Joins in Update queries

  • Thread starter Thread starter JonWayne
  • Start date Start date
J

JonWayne

Is it possible in Jet SQL and if so, how is the statement written?
 
Is it possible in Jet SQL and if so, how is the statement written?

Sometimes. Not all joined queries are updateable; for instance, any
Totals query or any query including a Totals query as a component will
not be updateable. A simple two-table join will be updateable *if*
there is a unique Index on the "one" table joining field (such as a
Primary Key) and an index on the joined field in the "many" table. For
example, if you have a table tblMain joined to tblChild on
fldJoinField, you can update a field in tblChild with an expression:

UPDATE tblMain
INNER JOIN tblChild
ON tblMain.fldJoinField = tblChild.tblJoinField
SET tblChild.ThisField = tblMain.ThatField;


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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