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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update query

Status
Not open for further replies.

meravsha

Programmer
Jul 27, 2001
21
0
0
IL
I wrote an Update query Like this:

UPDATE TblBill INNER JOIN TblBillByOrd ON (TblBill.Bl_CodeBill = TblBillByOrd.BO_CodeBill) SET TblBillByOrd.BO_ScannerNum = IIf([TblBill]![Bl_IsOpen]=3,1,0)

I run it in Access and it's work fine
I tried to run it in Sql Server but I got an error that
Sql server not allowed to update table with relantionship to other table.
How can I execute this quary?
 
Code:
UPDATE bo
SET bo_scannernum = CASE WHEN b.bl_isopen = 3 THEN 1 ELSE 0 END
FROM tblbillbyord bo JOIN tblbill b ON bo.bo_codebill = b.bl_codebill
--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top