One of the basic rules of data normalization is that your fields must be
atomic. That means, store only ONE thing in any field. Instead of putting
City and State in one field, use two.
Your question suggests that you have multiple pieces of information in
one
of the fields, and as a result you need to make partial matches. The
solution will be to break it down into multiple fields, so you can create
appropriate relationships between the tables and query the data
efficiently.
It is actually possible to put both tables into the query, and use Like
with
* as the wildcard character before and after the values to get matches.
For
example, in the criteria under
.[Contract#] you could put:
Like "*" & [Table1].[Contract#] & "*"
This is not only inefficient, but it also won't work for the example you
give, since the 1000 is inserted between the different values.
(And that's before you try to cope with the fact that Microsoft broke
Access
2000 and later so that it fails to match correctly on fields that contain
the hyphen character.)
How can I query to find records that match on any part of a field?
Ex:
Table 1 Contract# Contract Date
1000-abc 1/1/06
Table 2 Contract# ContractName
General-1000-abc-1 Department
Supplies
I would want the contract # from table 1 to return as a match and see
both
contract # fields from table 1 and table 2.