>>It's a software for parking lot that I developed one year ago
>>
>>Car tags standard here are 3 letters and 4 numbers as: QAX9191
>>
>>To prevent customers to type QAX919 (motorcicle or foregner tags) and find the car tag QAX9191 accidently
>>I turned "set exact on"
>>
>>However a customer of mine wants to search only by the car tag number
>>
>>He wants to type 9191 and finds QAX9191
>>
>>The problem is that I use the whole search in unique textbox
>>
>>Is it possible to solve this problem withtout adding another textbox or a "set exact off " button ?
>
>One thing you could do would be to run both exact and inexact/partial queries, and present both sets of results.
Actually, since this is a limited size field, it can be a smart search all the way -
lcTag1="?"+lctag+"*"
lcTag2="??"+lctag+"*"
lcTag3="???"+lctag+"*"
select ..., 1 as rank... where cTag==lcTag ;
union ..., 2 as rank... where cTag=lcTag ;
union ..., 3 as rank... where cTag like lcTag1
union ..., 4 as rank... where cTag like lcTag2
etc etc (of course, build this on-the-fly, depending on the number of the characters entered), then present the final cursor ordered by rank, so the best matches come on top, even if the best match has only a rank of 4.