We have a sql query that shows all jobs that are COMPLETED, but not CLOSED
Query is -
select
[JobHead].[JobClosed] as [JobHead_JobClosed],
[JobHead].[JobComplete] as [JobHead_JobComplete]
from Erp.JobHead as JobHead
inner join Erp.JobProd as JobProd on
JobHead.Company = JobProd.Company
and JobHead.JobNum = JobProd.JobNum
and ( JobProd.ShippedQty > 0 or JobProd.ReceivedQty > 0 )
where (JobHead.JobComplete = 1 and JobHead.JobClosed <> 1)
--
We want to update the JobHead.JobClosed value to be 1 for all records returned in this select statement
How can we do that with an Update statement when we have a join and where condition?