Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optional Wildcard character

Status
Not open for further replies.

xsnrg

Technical User
Jun 15, 2004
44
US
I am attempting to automated a document search in my database using wildcard options.

I have a field on a form that asks what to search for...
A user can for example type 'CO##_' and they will get all documents that have the letters "CO" followed by a 2 digit number and an "_".
If they type 'c2' it will file anything with "c2" in the name.

However...
I want the ability to find both "c2" and "c-2" in the same search. Is there a wild card I can use that is an optional character
For example a 'c?2' would allow ANY character between the 'c' and the '2', but it will NOT find those with NO character between the 'c' and '2'. How can I get both results in one search?


McLean Jones
buddycenters.org
"Believing is Seeing
 
Hey

SELECT *
FROM Delete_Table
WHERE TableValue LIKE "a?a"

Returns only records that HAVE values that start with a and have a third letter of a.

SELECT *
FROM Delete_Table
WHERE TableValue LIKE "a*a"

Returns records the same records above but also records like "aa" which have no values in between.

Snowcrash
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top