Ignoring Text in Search Field OR Give Priority to a Search Field

B

bfiser

Here is a scenario that was laid out to me. We used the DBRW to create
a search page. Everything is working fine and it was presented to our
boss. Our search fields are Last Name, First Name and Employee ID. My
boss asked if we could give a priority to Employee ID. Meaning if I
put in a last name, first name or portion of last or first name but
also an entire Employee ID can we have it only give back the result for
the matching Employee ID? I am not against modifying the code
manually if I can't do this by modifying my Results Wizard options.
Also if this is not possible please let me know he would accept that as
an answer.
 
S

Stefan B Rusynko

Change your query to make EmployeeID first and the other parameters secondary as OR

s-sql="SELECT * FROM tablename WHERE EmployeeID='::EmployeeID::' OR (LastName ='::LastName::' OR First Name='::FirstName::')"

Dependng on what you want you could make the last 2 LIKE instead of Equal To


_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Here is a scenario that was laid out to me. We used the DBRW to create
| a search page. Everything is working fine and it was presented to our
| boss. Our search fields are Last Name, First Name and Employee ID. My
| boss asked if we could give a priority to Employee ID. Meaning if I
| put in a last name, first name or portion of last or first name but
| also an entire Employee ID can we have it only give back the result for
| the matching Employee ID? I am not against modifying the code
| manually if I can't do this by modifying my Results Wizard options.
| Also if this is not possible please let me know he would accept that as
| an answer.
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top