Solved

Update on a Join Statement

Posted on 2014-04-10
2
170 Views
Last Modified: 2014-04-21
I'm having a hell of a time with a seemingly easy statement. I have verified all the tables and fields are correct

use pbj_2be

UPDATE ACH_1114b 
SET [Status] = 'en'
inner JOIN dbo.[tblBNK_GRP_ENT]
ON ACH_1114b.[account number] = tblBNK_GRP_ENT.ACCT 

WHERE ACH_1114b.[Status]='EN' AND tblBNK_GRP_ENT.GroupedPmts = 0 

Open in new window


the error i get is Msg 156, Level 15, State 1, Line 9
Incorrect syntax near the keyword 'inner'.
0
Comment
Question by:damixa
2 Comments
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
Comment Utility
UPDATE t1
SET [Status] = 'en'
FROM ACH_1114b AS t1
INNER JOIN dbo.[tblBNK_GRP_ENT] AS t2
ON t1.[account number] = t2.ACCT 
WHERE t1.[Status]='EN' AND t2.GroupedPmts = 0 

Open in new window

0
 

Author Closing Comment

by:damixa
Comment Utility
Thanks
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now