Update Query Help

  • Thread starter Thread starter RCL
  • Start date Start date
R

RCL

The following query runs without error, but does not update the fields. I
have a similar query that works fine. Any help is appreciated.

UPDATE SummryT002, SummryT003_RptData
SET SummryT002.RptName = SummryT003_RptData!RptName,
SummryT002.RptBegDt = SummryT003_RptData!RptBegDt,
SummryT002.RptEnd = SummryT003_RptData!RptEnd
WHERE (((SummryT002.IDToUse)=[SummryT003_RptData].[IDToUse]));
 
The following query runs without error, but does not update the fields. I
have a similar query that works fine. Any help is appreciated.

UPDATE SummryT002, SummryT003_RptData
SET SummryT002.RptName = SummryT003_RptData!RptName,
SummryT002.RptBegDt = SummryT003_RptData!RptBegDt,
SummryT002.RptEnd = SummryT003_RptData!RptEnd
WHERE (((SummryT002.IDToUse)=[SummryT003_RptData].[IDToUse]));

Use a JOIN clause rather than joining in the WHERE clause, and a
period rather than an exclamation point to delimit fieldnames:

UPDATE SummryT002 INNER JOIN SummryT003_RptData
ON SummryT002.IDToUse=[SummryT003_RptData].[IDToUse]
SET SummryT002.RptName = SummryT003_RptData.RptName,
SummryT002.RptBegDt = SummryT003_RptData.RptBegDt,
SummryT002.RptEnd = SummryT003_RptData.RptEnd;


John W. Vinson[MVP]
 
In addition to John's response, may I ask how you are running the query?

If you are simply switching to the table grid, then you are not executing the
query. Try clicking on the RUN button (a red exclamation mark) or selecting RUN
from the menubar.

John said:
The following query runs without error, but does not update the fields. I
have a similar query that works fine. Any help is appreciated.

UPDATE SummryT002, SummryT003_RptData
SET SummryT002.RptName = SummryT003_RptData!RptName,
SummryT002.RptBegDt = SummryT003_RptData!RptBegDt,
SummryT002.RptEnd = SummryT003_RptData!RptEnd
WHERE (((SummryT002.IDToUse)=[SummryT003_RptData].[IDToUse]));

Use a JOIN clause rather than joining in the WHERE clause, and a
period rather than an exclamation point to delimit fieldnames:

UPDATE SummryT002 INNER JOIN SummryT003_RptData
ON SummryT002.IDToUse=[SummryT003_RptData].[IDToUse]
SET SummryT002.RptName = SummryT003_RptData.RptName,
SummryT002.RptBegDt = SummryT003_RptData.RptBegDt,
SummryT002.RptEnd = SummryT003_RptData.RptEnd;

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

Back
Top