|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
ASP Wilcard Search
I have an ASP search form on an Access db which allows me to search based on LastName, FirstName, or Club. When I added the wilcard "%" to the search query for LastName it disables the ability to search on the other two fields and returns ALL records.
s-sql="SELECT * FROM Alumni WHERE (Club = '::Club::' OR FirstName = '::FirstName::' OR LastName like '%::LastName::%') ORDER BY LastName ASC" It doesn't matter where I put a wildcard, it disables all the other search criteria Last edited by amateurASP : September 26th, 2003 at 01:14 PM. |
|
#2
|
|||
|
|||
|
I think you need to add the like condition to each of the search fields.
|
|
#3
|
|||
|
|||
|
I tried that but then I none of the search fields worked
|
|
#4
|
|||
|
|||
|
Actually the first two fields always return *.* the third field works fine
|
|
#5
|
|||
|
|||
|
Ok, I solved it by having one input field instead of 3, named "SearchValue" and then checking each db field against that value.
s-sql="SELECT * FROM Alumni WHERE (Club like '::SearchValue::%' OR FirstName like '::SearchValue::%' OR LastName like '::SearchValue::%') ORDER BY LastName ASC" |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > ASP Wilcard Search |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|