barblogan
09-07-2004, 09:54 AM
can someone help me with a query that will find similar but not exact values in two tables?
the value in T#1 might be like 123, but in T#2 it might be like 123abc or abc123
any help will be greatly appreciated...
monkeytunes
09-07-2004, 11:00 AM
If you know there are going to be similar characters in each field, use wildcards after your criteria:
Like "abc" & *
You might try combining it with a parameter prompt:
Like [Your question here] & "*"
barblogan
09-07-2004, 01:09 PM
I am a relative novice with Access queries....could you be a bit more specific, please??
monkeytunes
09-07-2004, 01:46 PM
In the Design View of your query, put one of the two lines that I posted before in the applicable field/fields:
Like "abc" & "*"
Will give you every record that has an instance of "abc" starting the field off. So it would give you records with "abc" and "abca" and "abxc2342riojfosjdf34kj" occuring in that field. By putting a wildcard on both sides, you would get every record with "abc" anywhere in that field. And so on. Experiment!
By putting in a parameter, the query will prompt you for input.
Like [Put any text you want here barblogon except for punctuation]
When you run the query, a pop-up will appear with "Put any text you want etc.", and a blank. If you type "abc" into the blank, you'd get every record with "abc" for that field.
By putting wildcards on either/both sides, you can then narrow/widen your seaches.
Experiment! (And let us know how it works out for you!)
Hope that helps!