473,721 Members | 3,997 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

syntax error for Update Query


I have this update query that I am trying to run. I know the syntax is
messed up but do not know how to correct it.

Select 'UPDATE', Transactions,'S et [balance] =[Daily Balance] where [Id]=
[Idalias]' From "Get Daily Balances"

Transactions = name of the table I want to update
balance = name of the field i want to update

daily balance= name of the query result that I want to move to the table
(this is the result of a Dsum)

ID=primary key in the table
IDalias = the query resulting copy of the ID number

Get daily balances = the name of the query that I need to update from

Thanks in advance for the help on writng the query correctly

Mark
--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200507/1
Nov 13 '05 #1
7 3530
Mark Carlyle via AccessMonster.c om wrote:
I have this update query that I am trying to run. I know the syntax is
messed up but do not know how to correct it.

Select 'UPDATE', Transactions,'S et [balance] =[Daily Balance] where [Id]=
[Idalias]' From "Get Daily Balances"

Transactions = name of the table I want to update
balance = name of the field i want to update

daily balance= name of the query result that I want to move to the table
(this is the result of a Dsum)

ID=primary key in the table
IDalias = the query resulting copy of the ID number

Get daily balances = the name of the query that I need to update from

Thanks in advance for the help on writng the query correctly

Mark

Can you use Access to create it? Open up the query designer
(Query/New/Design) and select/add table/query Transactions and "Get
Daily Balances". If needed, create a relationship line between the ID
fields. Now, drag the Balance field from Transactions. From the menu
select Query/Update to change it to an update query. In the Update row
for Balance, enter [Get Daily Balances]![Daily Balance]. Save and run.

You should end up with a query similar to this.

UPDATE Transactions INNER JOIN [Get Daily Balances] ON Transactions.ID =
[Get Daily Balances].IDAlias SET Transactions.Ba lance = [Get Daily
Balances]![Daily Balance];

Just curious. Why do people put spaces into table and query names? To
create more work for themselves?
Nov 13 '05 #2
Mark Carlyle via AccessMonster.c om wrote:
I have this update query that I am trying to run. I know the syntax is
messed up but do not know how to correct it.

Select 'UPDATE', Transactions,'S et [balance] =[Daily Balance] where [Id]=
[Idalias]' From "Get Daily Balances"

Transactions = name of the table I want to update
balance = name of the field i want to update

daily balance= name of the query result that I want to move to the table
(this is the result of a Dsum)

ID=primary key in the table
IDalias = the query resulting copy of the ID number

Get daily balances = the name of the query that I need to update from

Thanks in advance for the help on writng the query correctly

Mark

Can you use Access to create it? Open up the query designer
(Query/New/Design) and select/add table/query Transactions and "Get
Daily Balances". If needed, create a relationship line between the ID
fields. Now, drag the Balance field from Transactions. From the menu
select Query/Update to change it to an update query. In the Update row
for Balance, enter [Get Daily Balances]![Daily Balance]. Save and run.

You should end up with a query similar to this.

UPDATE Transactions INNER JOIN [Get Daily Balances] ON Transactions.ID =
[Get Daily Balances].IDAlias SET Transactions.Ba lance = [Get Daily
Balances]![Daily Balance];

Just curious. Why do people put spaces into table and query names? To
create more work for themselves?
Nov 13 '05 #3

Ok I get an error message that says "Operation must contain an updateable
Query"

Transactions is a table... Get Daily Balances is a Query of Transactions.

Salad wrote:
I have this update query that I am trying to run. I know the syntax is
messed up but do not know how to correct it.

[quoted text clipped - 16 lines]

Mark


Can you use Access to create it? Open up the query designer
(Query/New/Design) and select/add table/query Transactions and "Get
Daily Balances". If needed, create a relationship line between the ID
fields. Now, drag the Balance field from Transactions. From the menu
select Query/Update to change it to an update query. In the Update row
for Balance, enter [Get Daily Balances]![Daily Balance]. Save and run.

You should end up with a query similar to this.

UPDATE Transactions INNER JOIN [Get Daily Balances] ON Transactions.ID =
[Get Daily Balances].IDAlias SET Transactions.Ba lance = [Get Daily
Balances]![Daily Balance];

Just curious. Why do people put spaces into table and query names? To
create more work for themselves?

--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200507/1
Nov 13 '05 #4
Mark Carlyle via AccessMonster.c om wrote:
Ok I get an error message that says "Operation must contain an updateable
Query"
Most likely [Get Daily Balances] uses a Totals query in it or else is a
Totals query. If so, you'll need to adjust your method of updating and
not use a Total query.
Transactions is a table... Get Daily Balances is a Query of Transactions.

Salad wrote:
I have this update query that I am trying to run. I know the syntax is
messed up but do not know how to correct it.


[quoted text clipped - 16 lines]
Mark


Can you use Access to create it? Open up the query designer
(Query/New/Design) and select/add table/query Transactions and "Get
Daily Balances". If needed, create a relationship line between the ID
fields. Now, drag the Balance field from Transactions. From the menu
select Query/Update to change it to an update query. In the Update row
for Balance, enter [Get Daily Balances]![Daily Balance]. Save and run.

You should end up with a query similar to this.

UPDATE Transactions INNER JOIN [Get Daily Balances] ON Transactions.ID =
[Get Daily Balances].IDAlias SET Transactions.Ba lance = [Get Daily
Balances]![Daily Balance];

Just curious. Why do people put spaces into table and query names? To
create more work for themselves?


Nov 13 '05 #5

[Get Daily Balances] is a Dsum Query of a Totals Query.

What I need to do is update a table with the results of the Dsum Query.

Am I going about this all wrong?

Salad wrote:
Ok I get an error message that says "Operation must contain an updateable
Query"


Most likely [Get Daily Balances] uses a Totals query in it or else is a
Totals query. If so, you'll need to adjust your method of updating and
not use a Total query.
Transactions is a table... Get Daily Balances is a Query of Transactions.

[quoted text clipped - 20 lines]
Just curious. Why do people put spaces into table and query names? To
create more work for themselves?

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #6
Mark Carlyle via AccessMonster.c om wrote:
[Get Daily Balances] is a Dsum Query of a Totals Query.

What I need to do is update a table with the results of the Dsum Query.

Am I going about this all wrong?
Yes, if you are attempting to update from a Totals query.

You need to change your methodology of getting the balance.

Salad wrote:
Ok I get an error message that says "Operation must contain an updateable
Query"


Most likely [Get Daily Balances] uses a Totals query in it or else is a
Totals query. If so, you'll need to adjust your method of updating and
not use a Total query.

Transactio ns is a table... Get Daily Balances is a Query of Transactions.


[quoted text clipped - 20 lines]
Just curious. Why do people put spaces into table and query names? To
create more work for themselves?


Nov 13 '05 #7

Well, I figured out finally that there is no need to store the balance... why
not just create a query that gives the balance along with the other info I
wish to view.

Thanks a ton for your help!

Salad wrote:
[Get Daily Balances] is a Dsum Query of a Totals Query.

What I need to do is update a table with the results of the Dsum Query.

Am I going about this all wrong?


Yes, if you are attempting to update from a Totals query.

You need to change your methodology of getting the balance.
Ok I get an error message that says "Operation must contain an updateable
Query"[quoted text clipped - 9 lines]>Just curious. Why do people put spaces into table and query names? To
>create more work for themselves?

--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200507/1
Nov 13 '05 #8

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

Similar topics

3
2486
by: John Pastrovick | last post by:
I use a function, myrandomPIN (), to generate random PIN numbers. The following sql query updates records with the SAME PIN number but. I want to generate DIFFERENT pin numbers for every record. The function is ok but I can't figure out how to run it individually for each record. In other words I do not know the correct syntax to use UPDATE in a loop (if necessary) so that a different call to the function is done every time or ecah...
2
9651
by: DFS | last post by:
Version 1: -------------------------------- If Condition = A UPDATE query 1 UPDATE query 2 ELSE IF Condition = B UPDATE query
4
11336
by: deko | last post by:
I'm trying to update the address record of an existing record in my mdb with values from another existing record in the same table. In pseudo code it might look like this: UPDATE tblAddress SET AddressDescription of Entity 456 = AddressDescription of Entity_ID 123 Address1 of Entity 456 = Address1 of Entity_ID 123 City of Entity 456 = City of Entity_ID 123
0
388
by: Mark Carlyle via AccessMonster.com | last post by:
I have this update query that I am trying to run. I know the syntax is messed up but do not know how to correct it. Select 'UPDATE', Transactions,'Set = where = ' From "Get Daily Balances" Transactions = name of the table I want to update balance = name of the field i want to update daily balance= name of the query result that I want to move to the table
2
4814
by: technocraze | last post by:
Hi guys, I have encountered this error when updating the values to the MS Acess table. Error : Update on linked table failed. ODBC sql server error Timeout expired. MS Acess is my front end and sql server is my backend server. This error occured whenever i step through and when it reaches rs.update it jux hangs down there and thereafter it shwn the aforementioned error. I am using the RecordSet properties to add the values. Can I use...
2
3195
by: Flic | last post by:
Hi, I have a basic db that I access with MySQL query browser. Everything seems fine to me but I am using this db as part of a php shopping basket and when I try to add an item I get: Notice: Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '>function.extract]: First argument should be an array in functions.inc.php on line 31
1
1407
by: RamanS | last post by:
I have these variables: Dim str1Year As String Dim str5Years As String str1Year = "1 Year" str5Years = "5 Years" and this query statement If Me.frmEvergreen.Value = 1 Then
5
5490
by: Chris Kennedy | last post by:
Hi all I'm running SQL Server 2005 Express Edition. One database One table called Sites Fields as follows: id (bigint, Identity, Primary Key) SiteName (varchar(50), allows nulls) Generation (float) LastUpdated (varchar(50), allows nulls)
2
2337
by: benicio | last post by:
The subject update failed. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = 6' at line 5. This is in the edit_subject.php page. I dont know whats wrong with the query i;v had. <?php require_once("includes/connection.php"); ?> <?php require_once("includes/functions.php"); ?> <?php if (intval($_GET) == 0) {
0
8852
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8736
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9081
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6676
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5992
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4497
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4761
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2143
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.