My client has moved their back-end database from Access to SQL Server,
and now the following query doesn't work (Operation must use an
updateable query):
UPDATE tblbookings INNER JOIN tblREFUNDS ON tblbookings.Tra nsFromID =
tblREFUNDS.Book ingID SET tblREFUNDS.[MOVED TO NEW BKREF] =
tblbookings.boo kingid
WHERE (((tblREFUNDS.[MOVED TO NEW BKREF])=0) AND
((tblbookings.T ransFromID) Is Not Null));
Both the following variations seem to work, but I can't decide if they
are syntactically interchangeable :
UPDATE tblRefunds, tblBookings
SET [MOVED TO NEW BKREF] = tblbookings.boo kingid
WHERE (((tblREFUNDS.[MOVED TO NEW BKREF])=0) AND
((tblbookings.T ransFromID) Is Not Null)) AND (tblREFUNDS.Boo kingID =
tblbookings.boo kingid);
UPDATE tblREFUNDS AS R SET R.[MOVED TO NEW BKREF] = (SELECT
tblbookings.boo kingid from tblbookings where
tblbookings.Tra nsFromID = R.BookingID AND tblbookings.Tra nsFromID IS
Not Null)
WHERE (((R.[MOVED TO NEW BKREF])=0));
I can't really test this because it's live data, and time is
incredibly tight, so you have my copious thanks in advance.
Edward
and now the following query doesn't work (Operation must use an
updateable query):
UPDATE tblbookings INNER JOIN tblREFUNDS ON tblbookings.Tra nsFromID =
tblREFUNDS.Book ingID SET tblREFUNDS.[MOVED TO NEW BKREF] =
tblbookings.boo kingid
WHERE (((tblREFUNDS.[MOVED TO NEW BKREF])=0) AND
((tblbookings.T ransFromID) Is Not Null));
Both the following variations seem to work, but I can't decide if they
are syntactically interchangeable :
UPDATE tblRefunds, tblBookings
SET [MOVED TO NEW BKREF] = tblbookings.boo kingid
WHERE (((tblREFUNDS.[MOVED TO NEW BKREF])=0) AND
((tblbookings.T ransFromID) Is Not Null)) AND (tblREFUNDS.Boo kingID =
tblbookings.boo kingid);
UPDATE tblREFUNDS AS R SET R.[MOVED TO NEW BKREF] = (SELECT
tblbookings.boo kingid from tblbookings where
tblbookings.Tra nsFromID = R.BookingID AND tblbookings.Tra nsFromID IS
Not Null)
WHERE (((R.[MOVED TO NEW BKREF])=0));
I can't really test this because it's live data, and time is
incredibly tight, so you have my copious thanks in advance.
Edward
Comment