Hi!
Not so complicated as you can think first. The last one requires additional select:
Select top 1 code from ... where code like "A1??DDS" order by code.
This way you have exact 'From' value.
The same you can do to get 'To' value, but order in select will be descending.
Than just usual 'between' select, that also will be optimized.
If this is SQL Server, you can do this in a single select statement, because a single value expression could be a subquery.
>just wonding the best way to do a ranged search.
>say the user enters:
>"R01% - R02%" or
>"R01 - R0332441" or
>"1 - 99999" (this one is very easy) or
>"A1??DDS - FR6%" ( i think this one would too difficult) ,
>
>what would be the best way to get the desired results?
>
>any help would be appreciated
>- jer
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.