473,394 Members | 1,965 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,394 software developers and data experts.

having trouble with joins

I can't get this code to run on SQL server without the following error

Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword 'JOIN'.

UPDATE [tblAcsChargeAmts]
JOIN [T Accessorials_Estimated]
ON [tblAcsChargeAmts].[Shipment Id] = [T Accessorials_Estimated].[Shipment Id]
AND [tblAcsChargeAmts].[Load Id] = [T Accessorials_Estimated].[Load Id]
AND [tblAcsChargeAmts].[Acs Code] = [T Accessorials_Estimated].[Acs Code])
SET [tblAcsChargeAmts].[Est AP Amt] = [T Accessorials_Estimated].[AP Est Acs Amt],
[tblAcsChargeAmts].[Est AR Amt] = [T Accessorials_Estimated].[AR Est Acs Amt]
WHERE [tblAcsChargeAmts].[Est AP Amt] = 0
OR [tblAcsChargeAmts].[Est AR Amt] = 0;
Sep 24 '09 #1
1 1121
Delerna
1,134 Expert 1GB
Here is the example from SQL servers help documentation

Expand|Select|Wrap|Line Numbers
  1. UPDATE titleauthor
  2.    SET title_id = titles.title_id
  3.    FROM titles INNER JOIN titleauthor 
  4.       ON titles.title_id = titleauthor.title_id 
  5.       INNER JOIN authors
  6.       ON titleauthor.au_id = authors.au_id
  7.    WHERE titles.title = 'Net Etiquette'
  8.       AND au_lname = 'Locksley'
  9.  

you need to model your update query like that.

Just a hint....

There is a lot of help available in MSSQL's help (with examples) that answers questions like this. You access that help from "query analyser"....not from "Enterprise manager".
PS Im talking from the perspective of MSSQL Server 2000 here. It's probably different in later versions
Sep 24 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Chris Todhunter | last post by:
Hi, I am responsible for a growing website. It is password protected and we collect data on everyone who logs in. Every month we produce a report on the trends of users which can result in some...
14
by: BlackHawke | last post by:
My Name is Nick Soutter, I am the owner of a small game company, Aepox Games (We're in the middle of a name change from "Lamar Games"), www.lamargames.net. Our first commercial game,...
3
by: Prem | last post by:
Hi, I am having many problems with inner join. my first problem is : 1) I want to know the precedance while evaluating query with multiple joins. eg. select Employees.FirstName,...
4
by: jbm05 | last post by:
Hi, I'm curious about the computational complexity of a query I have. The query contains multiple nested self left joins, starting with a simple select, then doing a self left join with the...
4
by: michaelnewport | last post by:
Greetings, I like to write my inner joins as below, but someone at work tells me its not as 'performant' as using the 'inner join' statement. Is this true ? Is there a better way to write it...
7
by: Steve | last post by:
I have a SQL query I'm invoking via VB6 & ADO 2.8, that requires three "Left Outer Joins" in order to return every transaction for a specific set of criteria. Using three "Left Outer Joins"...
13
by: Marcus | last post by:
I am running a query that calculates student enrolment per course. The problem is, if the enrolment is zero, the entire row will not be displayed. I tried a variety of solutions, neither of...
2
by: narendra vuradi | last post by:
Hi I have a requirement where in i haev to convert the SQL from Oracle to the one which will run on the SQL server. in the Oracle Query i am doing multiple joins, between some 13 tables. and...
36
by: TC | last post by:
I've used Access for many years. Several times, I've encountered a bug which I refer to as the "Vanishing Joins" bug. When it happens, joins vanish randomly from queries. More specifically, all...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
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,...

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.