Error when Updating Records in the Same Table using a SQL Update Query

mbryan

New member
Local time
Yesterday, 18:55
Joined
Nov 2, 2016
Messages
3
I have the following SQL code and I am getting a error that simply states

Syntax Error in query expression ".

It then highlights the P in the middle of the code.

Here is the code and any help in determining the source of the error is appreciated. Thanks,

Code:
UPDATE RollInfo 

INNER JOIN RollInfo 

AS RollInfo_1 

ON (RollInfo.PalletNo = RollInfo_1.PalletNo) AND (RollInfo.PackListNo = RollInfo _1.PackListNo) 

SET RollInfo.PackageNo = [RollInfo _1].[GBN_Fin_Roll_ID]

WHERE (([RollInfo _1].[ReelSeq]=1));
 
Last edited by a moderator:
Please note the spaces in what appears to be a table name alias:
Code:
UPDATE RollInfo 

INNER JOIN RollInfo 

AS RollInf[COLOR="red"]o_[/COLOR]1 

ON (RollInfo.PalletNo = RollInfo_1.PalletNo) AND (RollInfo.PackListNo = RollInf[COLOR="Red"]o _[/COLOR]1.PackListNo) 

SET RollInfo.PackageNo = [RollInf[COLOR="red"]o _[/COLOR]1].[GBN_Fin_Roll_ID]

WHERE (([RollInf[COLOR="red"]o _[/COLOR]1].[ReelSeq]=1));
See if fixing alias to RollInfo_1 makes a difference.
 
Marlan

That did it, thanks a bunch!!!

Nothing like a fresh set of detailed eyes to look at something.

Thanks,

Mike
 

Users who are viewing this thread

Back
Top Bottom