Wildcards in records possible?

  • Thread starter Thread starter Ralph Hersener
  • Start date Start date
R

Ralph Hersener

I'm trying to query a table with an exact expression, where the table
contains values with wildcards.

I.e. search for: "ab1234"

records in db:
cd2345
de4567
ab1xx4

The record "ab1xx4" should be returned, as it matches most of the criteria
("x" would be the wildcard for any number, could also be any other string).

Does anyone know, how I could search the database (maybe with a selfwritten
function?) and how the wildcards could look like?

Thank you all very much in advance!

Ralph
 
I'm trying to query a table with an exact expression, where the table
contains values with wildcards.

I.e. search for: "ab1234"

records in db:
cd2345
de4567
ab1xx4

The record "ab1xx4" should be returned, as it matches most of the criteria
("x" would be the wildcard for any number, could also be any other string).

The LIKE operator accepts wildcards; normally you would have specific
values in the table and wildcards in the search expression BUT you can
do it the other way! If you use valid wilcard characters - ? for any
character, # for any digit - you could store

ab1##4

in the table, and use a query expression

WHERE "AB1234" LIKE [fieldname]
 
Phantastic! This way it works. Btw, on my Access-ODBC-configuration I need
to put an underscore into the fields as the one-character-wildcard
("ab1__4").

John, thank you very much for helping me on that one!

Best regards,
Ralph

John Vinson said:
I'm trying to query a table with an exact expression, where the table
contains values with wildcards.

I.e. search for: "ab1234"

records in db:
cd2345
de4567
ab1xx4

The record "ab1xx4" should be returned, as it matches most of the criteria
("x" would be the wildcard for any number, could also be any other
string).

The LIKE operator accepts wildcards; normally you would have specific
values in the table and wildcards in the search expression BUT you can
do it the other way! If you use valid wilcard characters - ? for any
character, # for any digit - you could store

ab1##4

in the table, and use a query expression

WHERE "AB1234" LIKE [fieldname]
 
Back
Top