Link to home
Start Free TrialLog in
Avatar of zimmer9
zimmer9Flag for United States of America

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.AgeRange)="1-5"));

What does the SET statement mean if you break it down?
Avatar of Argenti
Argenti
Flag of France image

the SET statement belongs to the UPDATE instruction
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.
ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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".