Or Like "*VIN*"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query that pulls a list of all loans secured by one or more
vehicles. Until I upgraded to Access 2003, the criteria I was using on the
Collateral field worked fine. Now, it also pulls loans secured by savings
accounts, probably because the word "savings" also contains the letters VIN.
To understand why that matters, look at the criteria, which I've pasted below.

Like "*vehicle*" Or Like "*auto*" Or Like "*moto*" Or Like "*boat*" Or Like
"*truck*" Or Like "*mobilehome*" Or Like "*jetski*" Or Like "*VIN*"

The part that's causing my problems, as you may have already guessed, is
"*VIN*". I have tried changing this to " VIN#" (with a space in front of
"VIN#"). I have also tried changing it to "VIN*" and "*VIN" and "*VIN#". When
I make any of these changes, the query only pulls one of 6 loans that it
should be pulling.

Loans secured by one or more vehicles almost always have "VIN#" in them. Any
ideas as to how I need to modify my query so it pulls the correct loans and
doesn't pull loans secured by savings accounts?

Many thanks,
GwenH
 
Could the field have VIN and Savings both in it at the same time (hopefully
not)? If not, then try

(Like "*vehicle*" Or Like "*auto*" Or Like "*moto*" Or Like "*boat*" Or Like
"*truck*" Or Like "*mobilehome*" Or Like "*jetski*" Or Like "*VIN*") And Not
(Like "*savings*")
 
Like "*VIN[!g]*"
Get all records with "VIN" in the field followed by any character other than
a g

Or
LIKE "*[!a]VIN*"
Get all records with "VIN" in the field unless there is an A right before
"VIN"
 
Oh thank you thank you! It worked perfectly!

Wayne Morgan said:
Could the field have VIN and Savings both in it at the same time (hopefully
not)? If not, then try

(Like "*vehicle*" Or Like "*auto*" Or Like "*moto*" Or Like "*boat*" Or Like
"*truck*" Or Like "*mobilehome*" Or Like "*jetski*" Or Like "*VIN*") And Not
(Like "*savings*")
 
Back
Top