PDA

View Full Version : converting data



chr1stoper1
07-13-2015, 11:33 AM
Hi I wonder if anyone can help me with a problem I have with some data. Is it possible to convert numbers in a one field to something else.I have received the data from someone else who uses a different type of data base.
I have a lot of data that has machines identified as numbers .For example tractor is 1 and all 1sin that field are tractor and 2s are trailers ect.
I would like to get rid of the numbers and convert them to the machines .I want to be able to do queries on the machines not numbers.
I hope this makes some kind of sence.

Thanks for reading this

jonh
07-13-2015, 02:17 PM
Sounds like normal relational table design.
Numbers generally take up less space than text, so it's normal to assign numbers to data that is often repeated. The number is called a key. You create one table with unique strings and keys (primary key) and wherever that string is used in other tables you use the number instead of the text (foreign key).

To replace the numbers with the original string (for display purposes), you join the tables together in queries and replace the number field with the text field.