Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 updating a column based on another column
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jim_jim
Constraint Violating Yak Guru

USA
306 Posts

Posted - 01/17/2013 :  09:17:34  Show Profile  Reply with Quote
Hi All
I'm trying to update a datetimefeild in a table from a datetimefeild in another table based on a cretia.Both the tables can be joined on a feild called requesno

Will the below query work ok

Update CR 
Set CR.contractdate = select CC.contractenddate from CC where FROM Customer_Request CR Inner join  CustomerContracts  CC
ON CR.requestno = CC.requestno
where CC.Indicator = 'Y' and requestno in


Thanks

webfred
Flowing Fount of Yak Knowledge

Germany
8781 Posts

Posted - 01/17/2013 :  09:30:37  Show Profile  Visit webfred's Homepage  Reply with Quote
update CR
set contractdate = CC.contractenddate
from Customer_Request CR
inner join CustomerContracts CC
ON CR.requestno = CC.requestno
where CC.Indicator = 'Y' and CC.requestno in (...?...)


Too old to Rock'n'Roll too young to die.
Go to Top of Page

jim_jim
Constraint Violating Yak Guru

USA
306 Posts

Posted - 01/17/2013 :  09:58:27  Show Profile  Reply with Quote
Thank You

quote:
Originally posted by webfred

update CR
set contractdate = CC.contractenddate
from Customer_Request CR
inner join CustomerContracts CC
ON CR.requestno = CC.requestno
where CC.Indicator = 'Y' and CC.requestno in (...?...)


Too old to Rock'n'Roll too young to die.

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000