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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querystring and an extremely flexible wildcard, possible?

Status
Not open for further replies.

ziggs

Technical User
Sep 21, 2000
195
US
I need to do a search on partial license plates in our system. For example, let's say the plate of 123ABC, 98CHEVY, and 4C00001 are in my DB. Now, due to my job, we
sometimes only get a partial plate. For example, I remember "123A" but not the rest. Now, I have a query string that already gives out a hit of 123ABC when I use the query of "123A" . Ex:

WHERE VEHILCE.PLATES like '%" & Ucase(Request.QueryString("plate")) & "%'"

But what I want to be able to do is allow the user to enter a more controlled query. In Seagate Crystal Reports, I would be able to enter the following to get the right plate of 123ABC in my DB. 123ABC or 123A?? or 123A* or *ABC or 123?BC, etc. I'd use cyrstal reports but that costs too much money for installing and training for just one query like this. So, if possible, how can I
create such a flexible ASP to do this? The query that I can't duplicate in Crystal and I want to in ASP, is when requesting results from "123?BC" . Thus, 123ABC, 123BBC, 123CBC, ..., all the way to 123ZBC would return if they were in the database.
 
I know this works when hitting an Oracle database but I'm not sure if it's an SQL standard or not, but it's worth a shot. Use an underscore '_' as a wildcard for a single character such as ...

123_BC

Hope this helps ... Ed (RoadRacer) Holguin

"I Hate Computers!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top