Demosthenes&Locke
New member
- Local time
- Today, 16:12
- Joined
- Jun 22, 2010
- Messages
- 7
Keyword query, need it to create field in data table with field keyword was found in
I've got 2 tables, one which has records in it, and I have a second table that has is only a lookup table and not conforming to good database practices with keywords in it. Each field on the lookup table is a category and I need the query to add a field to the records table if it doesn't exist or fill that field for that record telling which field the keyword match in the lookup table was from.
Here's an example of what I have and *what I want it to do*:
Reads fields from table 1 checking for words from a specific field in table 2, when finding a word in any record from that field of table 2, puts the record in new table, I would like it to then *populate a field in the data table with the name of the field from the lookup table where the word was found*
*I would like it to do this for every field in the lookup table until all records are sorted, and if it runs out of fields and there are still records left to be sorted, label them as Other in the field dedicated to which field the keyword source was in*
Can anyone help? I've got it working as far as taking records and putting them in a table based on keywords in the lookup table but I don't know how to make it do more than one field at the same time, and if I did that then I would just end up with all records in a different order unless I knew how to fill a field with the label noting which field the word was found in.
I've got 2 tables, one which has records in it, and I have a second table that has is only a lookup table and not conforming to good database practices with keywords in it. Each field on the lookup table is a category and I need the query to add a field to the records table if it doesn't exist or fill that field for that record telling which field the keyword match in the lookup table was from.
Here's an example of what I have and *what I want it to do*:
Code:
TABLE1:
Record# Description1 Description2 OtherStuff Blah
123456 Inspection AnotherVehicle Other Blah
123457 RepairWaterPump Aerovan ExplodesOnImpact Blah
123458 CrazyDataEntry HouseInspect HideTheSafe blah
TABLE2:
Inspection Pumps Crazy
Inspec Pump Crazy
relief pmp explosion
Reads fields from table 1 checking for words from a specific field in table 2, when finding a word in any record from that field of table 2, puts the record in new table, I would like it to then *populate a field in the data table with the name of the field from the lookup table where the word was found*
*I would like it to do this for every field in the lookup table until all records are sorted, and if it runs out of fields and there are still records left to be sorted, label them as Other in the field dedicated to which field the keyword source was in*
Can anyone help? I've got it working as far as taking records and putting them in a table based on keywords in the lookup table but I don't know how to make it do more than one field at the same time, and if I did that then I would just end up with all records in a different order unless I knew how to fill a field with the label noting which field the word was found in.
Last edited: