Click here to Skip to main content
15,867,835 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
UPDATE Parts SET Parts.DispositionIDX =Disposition.DispositionIDX 
 FROM Parts INNER JOIN Disposition ON Parts.DispositionIDX = Disposition.Disposition
 WHERE PartIDX =7


What I have tried:

What am i missing here
Posted
Updated 15-Dec-17 3:01am
v2
Comments
CHill60 14-Dec-17 17:12pm    
What is the actual error?
And this is not VB.Net!
Suvendu Shekhar Giri 14-Dec-17 21:11pm    
Doesn't look to be a syntax error.
Please share the actual error message.

The only syntax error I can see you being able to get is one of the following:
Msg 208, Level 16, State 1, Line 1
Invalid object name 'Parts'.

Msg 208, Level 16, State 1, Line 1
Invalid object name 'Disposition'.

Msg 4104, Level 16, State 1, Line 2
The multi-part identifier "Parts.Disposition" could not be bound.

Msg 207, Level 16, State 1, Line 2
Invalid column name 'Disposition'.

Msg 207, Level 16, State 1, Line 3
Invalid column name 'PartIDX'.
- 208 Errors - you have misspelled the name of the table you want to use
- 207 Errors - you have misspelled the name(s) of (a) column you want to use
- 4104 Error - you have misspelled the name of the column on the join (or mixed up which column is in which table)

It does look very much as if you have a column DispositionIDX on your Disposition table but are trying to join using (a possibly non-existent) column Disposition

If this doesn't help then reply with the text of the actual error message
 
Share this answer
 
I do have columns DispositionIDX and Disposition in my Disposition Table and DispositionIDX in my Parts table.

I am trying to update the Parts table when user changes the disposition.
In the parts table, dispositionIDX is number(integer) but in my Datagrid i am displaying the Disposition(String) from disposition table using combobox ex - Hold, Process...etc it stores its IDX in parts table in db.
When the user changes the disposition in the datagrid it should change its Disposition IDX in the table, thats where i am trying to execute this query first in MSAccess.

Syntax Error says : Syntax error(Missing Operator) in query expression 'Disposition.DispositionIDX from Parts Inner Join Disposition ON Parts.DispositionIDX = Disposition.DispositionIDX
 
Share this answer
 
Comments
Richard Deeming 18-Dec-17 16:10pm    
If you want to reply to a solution, click the "Have a Question or Comment?" button under that solution.

If you want to reply to a comment, click the "Reply" button next to the comment.

DO NOT post your reply as a "solution"!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900