I have tried do an advance search using the below code but it displays everying in the database it does not filter out the results based on the criteria the user wants, does anyone have any suggestions on where I have gone wrong in my sql statement. the sql statement is in a sub which is executed after validate.
strphYSpecialty = trim(Request("Specialty"))
strmedicalschool = trim(Request("medicalschool"))
strphylastname = trim(Request("lastname"))
strBoardStatus = trim(Request("BoardStatus"))
strphyemail = trim(Request("email"))
txtsql= "SELECT a.PhysicianId, a.PhySpecialty, a.phyemail, a.Phyhomephone,a.Phylastname, a.Phyfirstname, b.MedicalSchool, b.Internship, b.Residency, b.SalaryExpected,"_
& " b.BoardStatus,b.LicenseStates,b.SalaryExpected, b.SponsEmpVisaStatus"_
& " from Physiciancontact AS a inner JOIN physicianqualifications AS b ON a.physicianid = b.physicianid)"_
& " Where Specialty LIKE '" & strphYSpecialty & "%' " _
& " or MedicalSchool LIKE '" & strmedicalschool & "%' " _
& " or lastname LIKE '" & strphylastname& "%' " _
& " or BoardStatus LIKE '" & strphYSpecialty & "%' " _
& " or email LIKE '" & stremail & "%' " _
& " order by a.customerID;"
Thanks for help in advance
strphYSpecialty = trim(Request("Specialty"))
strmedicalschool = trim(Request("medicalschool"))
strphylastname = trim(Request("lastname"))
strBoardStatus = trim(Request("BoardStatus"))
strphyemail = trim(Request("email"))
txtsql= "SELECT a.PhysicianId, a.PhySpecialty, a.phyemail, a.Phyhomephone,a.Phylastname, a.Phyfirstname, b.MedicalSchool, b.Internship, b.Residency, b.SalaryExpected,"_
& " b.BoardStatus,b.LicenseStates,b.SalaryExpected, b.SponsEmpVisaStatus"_
& " from Physiciancontact AS a inner JOIN physicianqualifications AS b ON a.physicianid = b.physicianid)"_
& " Where Specialty LIKE '" & strphYSpecialty & "%' " _
& " or MedicalSchool LIKE '" & strmedicalschool & "%' " _
& " or lastname LIKE '" & strphylastname& "%' " _
& " or BoardStatus LIKE '" & strphYSpecialty & "%' " _
& " or email LIKE '" & stremail & "%' " _
& " order by a.customerID;"
Thanks for help in advance