Need to populate a field in a record based on criteria

  • Thread starter Thread starter Robert
  • Start date Start date
R

Robert

I need to update a field in a record. There are about 25K
records. each record has a field named "Work_Code" which
is an alpha numeric. (123abc) Each record also has a
blank field named "Group". I would like to populate this
field with one of five entries "Executive 1 thru Executive
5" based upon the "Work_Code" I.e. all 123's should also
have the field "Group" populated with "Executive 1" and
all 456's should have "Executive 2" in the "Group" field.

I appreciate any and all help in this.

Robert
 
I need to update a field in a record. There are about 25K
records. each record has a field named "Work_Code" which
is an alpha numeric. (123abc) Each record also has a
blank field named "Group". I would like to populate this
field with one of five entries "Executive 1 thru Executive
5" based upon the "Work_Code" I.e. all 123's should also
have the field "Group" populated with "Executive 1" and
all 456's should have "Executive 2" in the "Group" field.

I appreciate any and all help in this.

Robert

If the new field can always be determined from the Group then it's
probably best not to store it - but since Work_Code is an improper,
non-atomic composite field already, I'll spare you the normalization
rant! <g>

Run an Update query, updating Group to

Switch(Left([Work_Code],3) = "123", "Executive 1", Left([Work_Code] =
"456"), "Executive 2]", <etc>)
 
Back
Top