Update query

  • Thread starter msnews.microsoft.com
  • Start date
M

msnews.microsoft.com

Using Access 2000:

Trying to use an update query to update a field. I would like it to put one
name in record 1, a different name in record 2, and then a different name in
record three. Then in record 4 I would like it to start the three name
process again. For example:

Record Agent
1 Smith
2 Jones
3 Hall
4 Smith
5 Jones
6 Hall

....and so forth through the 6000+ records.


Pete Provencher
 
J

John Spencer (MVP)

Is Record a number in a field? If so you can use that fact to do every record
divisible by 3 with a remainder of 0, 1, or 2.

UPDate YourTable
Set Agent = Switch(([Record] Mod 3)+1,"Smith","Jones","Hall")

If you want to only update records where Agent is blank then add
WHERE Agent is Null
to the end of the query
 
Top