PDA

View Full Version : Table Search Query?


bobo
05-23-2003, 01:57 PM
I'm using this search query:

rsSearch.Open "SELECT * FROM tblIncedent WHERE regNo LIKE '%"&srchval&"%'" & " OR make LIKE '%"&srchval&"%'"& " OR county LIKE '%"&srchval&"%' ORDER BY IncedentID DESC", dbconn

But I want to be able to search that whole (tblIncedent) table instead of the 3 select records, how do I search the whole table?

Thanks for any help.

bobo
05-23-2003, 02:38 PM
What I really want it to do is to search using more than 1 word which it doesn't do at the mo. So how to I search for say FORD (make) in DERBYSHIRE (county). I would type ford derbyshire in the seach box, all it allows at the moment is for them to be searched for seperatley.

help
05-27-2003, 10:24 AM
Try declaring two variables, searchval and searchall and name searchval to textbox and searchall to checkbox in your form and give value =1.

searchval = Replace(Request.Form("Searchval")."",""")
searchall = Request.form("all")

If searchall=1 then
SQL = ........

End If