Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access Database-Update Query Error - Cannot Update

Posted on 2014-01-15
2
Medium Priority
?
156 Views
Last Modified: 2014-03-21
I have been having problems with what I thought was an  easy update query, using the following query, and the error prompt simply says it cannot update database.  I have tested this code many times trying to run an update query to replace existing staging table values with mapped values.  Appreciate it if anyone can help.

The SQL Code is as follows:

UPDATE stgOutcomeDataUpload
SET stgOutcomeDataUpload.SPassABC = (SELECT  lkpStage4FieldMappings.FieldValue
FROM  lkpStage4FieldMappings, stgOutcomeDataUpload
WHERE stgOutcomeDataUpload.SPassABC = lkpStage4FieldMappings.FieldString AND (((lkpStage4FieldMappings.FieldName)="SPassABC")));


thanks
0
Comment
Question by:yasanthax
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
chaau earned 450 total points
ID: 39783997
Your query is incorrect. Try this one:
UPDATE stgOutcomeDataUpload  
INNER JOIN lkpStage4FieldMappings 
ON stgOutcomeDataUpload.SPassABC = lkpStage4FieldMappings.FieldString 
SET stgOutcomeDataUpload.SPassABC = lkpStage4FieldMappings.FieldValue
WHERE lkpStage4FieldMappings.FieldName="SPassABC";

Open in new window

0
 

Author Comment

by:yasanthax
ID: 39792406
Sorry for the late response.  This works.  May thanks.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question