From: SF on
Thank you. It works.

SF

"Michael Coles" <admin(a)geocodenet.com> wrote in message
news:%23Aikmq7dKHA.2460(a)TK2MSFTNGP04.phx.gbl...
> Oops, typo. Here's a better version:
>
> UPDATE tblProjectWorkPlan
> SET Owner = 'Ratha'
> WHERE Pjw_Pr_ObjectID IN
> (
> SELECT t.Pr_ObjectID
> FROM tblProject t
> WHERE t.Pr_Year = 2008
> AND t.Pr_ProvinceID = 2
> );
>
> Or Plamen's EXISTS version, which should be equivalent.
>
> --
> Thanks
>
> Michael Coles
> SQL Server MVP
> Author, "Expert SQL Server 2008 Encryption"
> (http://www.apress.com/book/view/1430224649)
> ----------------
>
> "Michael Coles" <admin(a)geocodenet.com> wrote in message
> news:OKkRTk7dKHA.3792(a)TK2MSFTNGP02.phx.gbl...
>> Try something like this (***untested***):
>>
>> UPDATE tblProjectWorkPlan
>> SET Owner = 'Ratha'
>> WHERE Pjw_Pr_ObjectID =
>> (
>> SELECT t.Pr_ObjectID
>> FROM tblProject t
>> WHERE t.Pr_Year = 2008
>> AND t.Pr_ProvinceID = 2
>> );
>>
>> --
>> Thanks
>>
>> Michael Coles
>> SQL Server MVP
>> Author, "Expert SQL Server 2008 Encryption"
>> (http://www.apress.com/book/view/1430224649)
>> ----------------
>>
>> "SF" <samnangs(a)pactcambodia.org> wrote in message
>> news:OKIm2H7dKHA.4636(a)TK2MSFTNGP04.phx.gbl...
>>> Hi,
>>>
>>> I am from Access background. I am stuck with write store procedure in
>>> SQL. How do I convert Access update statement below into SQL update one
>>>
>>> UPDATE tblProject INNER JOIN tblProjectWorkplan ON
>>> tblProject.Pr_ObjectID = tblProjectWorkplan.Pjw_Pr_ObjectID SET
>>> tblProjectWorkplan.Owner = "Ratha"
>>> WHERE (((tblProject.Pr_Year)=2008) AND ((tblProject.Pr_ProvinceID)=2));
>>>
>>> SF
>>>
>>
>