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?
zimmer9Asked:
Who is Participating?
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Your updating the field

tblOpenItemsAged.[1-5 Items]

and setting it equal to:

[items]

also:

tblOpenItemsAged.[1-5 $] = [$]

Jim.
0
 
ArgentiCommented:
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.
0
 
ArgentiCommented:
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".
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.