Updating table

belsha

Registered User.
Local time
Today, 17:40
Joined
Jul 5, 2002
Messages
115
I have used a make table query to create a table with text values. I need to convert these values to numerical data, for instance "Male" should become 1 and "Female" should become 0. I tried doing this in an update query, but had to use 2 separate queries. Don't know if a macro would work to update a table (there are no forms in this DB, it's all data fields). Same with code, I usually do this with forms. How can I update the raw data, which in some cases has multiple ifs, into the correct format? Thanks!
 
Forgive me for not understanding, but do you create 2 tables, one with the old data (in my case the text values) and another table with the new fields formatted to what I need (numbers)? Then join these two together on the primary key (which is the same) and do the update query? I tried this but it isn't working, am trying to update "yes, w/seg" in the first table to 2 in the second, and am getting a blank after the update. Or did you create a lookup table in the new table and use that also in the query?
 
Think I got it, 1 table, both old and new in it, new has the lookup table, update query contains the table and the lookup table. Lookup table has the number field, and the text field. Link to the table on the text field and the old field, update to the new number field, right?
 

Users who are viewing this thread

Back
Top Bottom