Solved

Access Database-Update Query Error - Cannot Update

Posted on 2014-01-15
2
150 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
2 Comments
 
LVL 24

Accepted Solution

by:
chaau earned 150 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Oracle SQL - Query help 7 59
SQL Query 26 66
Showing random records from database 10 37
CSV How to add columns based on existing column(s)? 20 16
As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

825 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