Hi everyone. I have two tables that are joined together by two fields - "Date" and "TrapID" (together they make up the primary key). I want to update a field ("DaysInField") in the 1st table based on a field ("DaysInField2") in the 2nd table, but only where a field ("Date2") in the 2nd table isn't NULL. I've tried 2 versions of code as pass-through queries in Access, and even though I don't recieve an error nothing gets updated. Any ideas?
I have a similar Access query that actually works. A png image of the design view can be seen here:
Version 1:
UPDATE tData
SET tData.DaysInField = tUpdateDaysInField.DaysInField2
FROM tData
INNER JOIN tUpdateDaysInField
ON (tData.Date = tUpdateDaysInField.Date) AND (tData.TrapID = tUpdateDaysInField.TrapID)
WHERE Not (tUpdateDaysInField.Date2 Is Null)
Version 2:
UPDATE tData
SET tData.DaysInField = tUpdateDaysInField.DaysInField2
FROM tData,tUpdateDaysInField
WHERE ((tData.Date = tUpdateDaysInField.Date) AND (tData.TrapID = tUpdateDaysInField.TrapID)) AND Not (tUpdateDaysInField.Date2 Is Null)
I have a similar Access query that actually works. A png image of the design view can be seen here:
Version 1:
UPDATE tData
SET tData.DaysInField = tUpdateDaysInField.DaysInField2
FROM tData
INNER JOIN tUpdateDaysInField
ON (tData.Date = tUpdateDaysInField.Date) AND (tData.TrapID = tUpdateDaysInField.TrapID)
WHERE Not (tUpdateDaysInField.Date2 Is Null)
Version 2:
UPDATE tData
SET tData.DaysInField = tUpdateDaysInField.DaysInField2
FROM tData,tUpdateDaysInField
WHERE ((tData.Date = tUpdateDaysInField.Date) AND (tData.TrapID = tUpdateDaysInField.TrapID)) AND Not (tUpdateDaysInField.Date2 Is Null)