473,397 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

what's wrong with this SQL for access?

UPDATE T1
SET T1.F1 =

(SELECT T2.FA
from T2

where
T1.F2=T2.FB+1
AND T1.F3= T2.FC
AND T1.F4= T2.FD
AND T1.F5= T2.FE+1
AND T1.F6= T2.FF
AND T1.F7= T2.FG
AND T1.F8= T2.FH
AND T1.F9= T2.FI);

I'm getting "Operation must use an updateable query" but that seems
inconsistent with the explanation of this error in the help. If I
select using the same syntax, it works. Thanks!

Dec 11 '06 #1
1 1083
cathy wrote:
UPDATE T1
SET T1.F1 =

(SELECT T2.FA
from T2

where
T1.F2=T2.FB+1
AND T1.F3= T2.FC
AND T1.F4= T2.FD
AND T1.F5= T2.FE+1
AND T1.F6= T2.FF
AND T1.F7= T2.FG
AND T1.F8= T2.FH
AND T1.F9= T2.FI);

I'm getting "Operation must use an updateable query" but that seems
inconsistent with the explanation of this error in the help. If I
select using the same syntax, it works. Thanks!
My recollection is that the syntax you display works in MS-SQL Server
but not in JET (since I do no JET these days my recollection is pretty
hazy.)

I believe this example of SQL will effect the same result you are
seeking:
CurrentDb.Execute "UPDATE (SELECT c.CompanyName, mlc.CompanyName "
_
& "FROM Customers AS c INNER JOIN MyLocalCustomers as mlc " _
& "ON C.CustomerID = MLC.CustomerID) SET
c.CompanyName=mlc.CompanyName"

This works in Access 2007. Of course, this is ACE and not JET but my
recollection, again hazy, is that this has always worked in JET.

As a general preference I always use JOINs; my experience with JOINs is
that they are accepted more often, and transferable among technolgies
more readily. They may or may not be faster, depending upon how they
are optimized; I don't know of any case where they are slower.

Thanks for a question for which the right answer is not, "Forget
Access, melt down your computer and become a head gigolo". This group's
quality is in free-fall.

Dec 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Simom Thorpe | last post by:
Hi, I'm trying to insert a line into a MS access DB using ASP on IIS 5. This is the line: con.execute "INSERT INTO newProds(title,desc,catcode) VALUES ('Champagne Muff Scarf','','AC304B')"...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
24
by: Steven T. Hatton | last post by:
If I understand correctly, I have no assurance that I can determine the type of a simple class instance thrown as an exception unless I explicitly catch it by name. (non-derived classes having no...
7
by: Vic | last post by:
Dear All, I found this code snippet on this list (taken from a nice webpage of a courteous fellow), which I used to filter a form on a combo box. I wanted to repeat the same code to have an...
51
by: WindAndWaves | last post by:
Can anyone tell me what is wrong with the goto command. I noticed it is one of those NEVER USE. I can understand that it may lead to confusing code, but I often use it like this: is this...
8
by: Brian Basquille | last post by:
Hello all, Bit of a change of pace now. As opposed to the typical questions regarding my Air Hockey game, am also working on a Photo Album which uses an Access Database to store information...
3
by: brianbasquille | last post by:
Hello all, Strange little problem here... am just trying to insert some basic information into an Access Database using OleDB. I'm getting a "Syntax error in Insert Into statement" when it...
9
by: Pyenos | last post by:
import cPickle, shelve could someone tell me what things are wrong with my code? class progress: PROGRESS_TABLE_ACTIONS= DEFAULT_PROGRESS_DATA_FILE="progress_data" PROGRESS_OUTCOMES=
11
by: Paul Brady | last post by:
Apparently, I have been living on the wrong planet. I have written 15 databases in Microsoft Access in the past 10 years, some of which are split, one uses ODBC interface with a SQL server, one...
6
by: CTG | last post by:
"update set UPDATE-FLAG=false, UPDATE-DT= '10/09/2007 4:09:59 PM' WHERE ICCID='I1' " UPDATE_FLAG is a YES/NO ICCID is TEXT I have tried YES, NO as well but still fails,
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.