Advertisement

04.25.2008 at 12:36PM PDT, ID: 23354706
[x]
Attachment Details

SQL Update Query on Joined Tables

Asked by Delta7428 in MS SQL Server, SQL Query Syntax, SQL Server 2005

Tags: Microsoft, SQL Server, 2005

What's wrong with this query?  I am linking 2 tables on their key field and need to update 1 based on a field value in the other.

UPDATE Table1
INNER JOIN Table2
      ON Table1.ID = Table2.ID
SET Table1.Status = 'R'
WHERE Table2.Complete Is Null Or Table2.Complete=0
AND Table1.ReleaseDate Is Not Null AND Table1.ReleaseDate>=Date-30


Error message is ... Incorrect syntax near the keyword 'INNER'.

Start Free Trial
[+][-]04.25.2008 at 12:38PM PDT, ID: 21442631

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 12:49PM PDT, ID: 21442713

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 01:01PM PDT, ID: 21442788

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.25.2008 at 01:57PM PDT, ID: 21443153

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 02:30AM PDT, ID: 21444995

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.26.2008 at 06:44AM PDT, ID: 21445503

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL Server, SQL Query Syntax, SQL Server 2005
Tags: Microsoft, SQL Server, 2005
Sign Up Now!
Solution Provided By: momi_sabag
Participating Experts: 4
Solution Grade: A
 
 
[+][-]04.26.2008 at 07:27AM PDT, ID: 21445641

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628