1. it suppose to be ONE update statement. Not TWO.UPDATE invoicecopySET PaymentDate = GETDATE() ,UPDATE invoicecopySET PaymentTotal = CreditTotalWHERE (CreditTotal > 0)
2. UPDATE InvoiceCopySET TermsID = 2WHERE VendorID IN ( SELECT VendorID FROM VendorCopy WHERE DefaultTermsID = 2 )AND TermsID <> 2
3. i will show you how the SELECT with INNER JOIN, try to convert it to the UPDATE statementSELECT < column list here >FROM InvoiceCopy AS i INNER JOIN VendorCopy AS v ON i.VendorID = v.VendorIDWHERE < where condition here >
4. Question does not make sense to me. the NOT IN should be checking from InvoiceCopy table. InvoiceCopy does not contain the VendorState column. So i am not sure how to make use of "SELECT DISTINCT VendorState" Also, your delete statement there will not delete anything. the subquery will return all distinct VendorState value from VendorCopy table and the DELETE is to delete NOT IN from VendorCopy. Try this and see anyting returnDELETE SELECT * FROM VendorCopy WHERE vendorState NOT IN(SELECT DISTINCT VendorState FROM VendorCopy)
KH[spoiler]Time is always against us[/spoiler]