Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update/Join - Zero Recs Returned

Status
Not open for further replies.

trudye10

Programmer
Sep 8, 2006
67
HI Guys, I checked the Advance Search and fashioned my Update/Join after them. But for some reason it is not working.

I created a SELECT query to insure my basic syntax was correct and it ran just fine. I ran a query in Access/SQL to insure my criteria was correct and I got back 2 records just as I did in the SQL Server SELECT.

I am not getting an error msg, I am getting Zero records affected.
Here is my code

Code:
UPDATE MCC_A 
SET MCC_A.InActive = 1
FROM CONN.johns.DDSLT AS D 
INNER JOIN MCC_A AS M 
ON D.LOAN = M.Account_Number
WHERE D.Status <> 'A'

Thanx,
Trudye
 
When you use aliases for the table names, you must keep them consistent throughout the query.

Code:
UPDATE [!]M[/!]
SET    [!]M[/!].InActive = 1
FROM   CONN.johns.DDSLT AS D
       INNER JOIN MCC_A AS [!]M[/!]
         ON D.LOAN = M.Account_Number
WHERE  D.Status <> 'A'

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Thank you so much George for responding, but I jumped the gun on this one. It did the Update! HURRAY!!

I had run it so many times (tweaking this and that) and it didn't work. It looked as it if was not working this time either.

Thanx again for taking the time to respond,
Be well,
Trudye
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top