Solved

Access Database-Update Query Error - Cannot Update

Posted on 2014-01-15
2
149 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Query syntax 10 40
Help with SQL field formatting 3 20
Substring() and LEFT() syntax 4 21
Updating a table from a temp table 4 25
In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
'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 …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

937 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now