updating new field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello
I would like to populate a new field (ELEMENT) based on the values of an existing field (ELCODE). The ELCODE field contains numerical values which I want to convert into new text. For example, a value of "1" in ELCODE would equal "men" in the ELEMENT field, a value of "2" in ELCODE would equal "women" in ELEMENT, etc. Can anybody help me
Thanks.
 
UPDATE MyTable
SET ELEMENT = Choose([ELCODE], "Men", "Women")

This assumes that ELCODE contains integer values from 1 to some number.
Enter additional values to cover 3, 4, 5, etc. If ELCODE is more complex
than that, consider using the Switch function.

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
fatuheeva said:
Hello,
I would like to populate a new field (ELEMENT) based on the values of an
existing field (ELCODE). The ELCODE field contains numerical values which I
want to convert into new text. For example, a value of "1" in ELCODE would
equal "men" in the ELEMENT field, a value of "2" in ELCODE would equal
"women" in ELEMENT, etc. Can anybody help me?
 
Back
Top