zimmer9
asked on
How to interpret the meaning of a SET statement in a query within an Access 2003 application?
I am maintaining an Access 2003 application and I came across the following query
UPDATE tblOpenItemsAged INNER JOIN tblOpenItemsAgeRange ON (tblOpenItemsAged.[Bank Code] = tblOpenItemsAgeRange.Bank) AND (tblOpenItemsAged.T = tblOpenItemsAgeRange.T) SET tblOpenItemsAged.[1-5 Items] = [items], tblOpenItemsAged.[1-5 $] = [$]
WHERE (((tblOpenItemsAgeRange.Ag eRange)="1 -5"));
What does the SET statement mean if you break it down?
UPDATE tblOpenItemsAged INNER JOIN tblOpenItemsAgeRange ON (tblOpenItemsAged.[Bank Code] = tblOpenItemsAgeRange.Bank)
WHERE (((tblOpenItemsAgeRange.Ag
What does the SET statement mean if you break it down?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In your case, the update statement changes the values in two columns ([1-5 items] and [1-5 $]) of the tblOpenItemsAged table.
Those columns will get the values located in the fields [items] and [$] of each row having AgeRange = "1-5".
Those columns will get the values located in the fields [items] and [$] of each row having AgeRange = "1-5".
and it's used to modify existing values in a table with the values indicated by the fields located after the SET keyword, for all the rows that match the logical condition in the WHERE section.
Here you have the official Microsoft explanation.