Question
Search using two criteria, using ASP/Access... argh!
My head is about to explode from this.
Although multilingual, I am admittedly NOT literate in SQL or ASP or JavaScript... that's what DW is for, right? Hmmmmmm.....
So my REcordset's Advanced View SQL looks like this:
SELECT ComapnyName, Address1, Address2, City, PostCode, TelNumber, FaxNumber, EMail, WebsitefURL, MapURL, LogoImage, Keyword1, Keyword2, Keyword3, Keyword4, Keyword5
FROM Cardiff
WHERE Keyword1 LIKE 'varBusType' OR Keyword2 LIKE 'varBusType' OR Keyword3 LIKE 'varBusType' OR Keyword4 LIKE 'varBusType' OR Keyword5 LIKE 'varBusType' OR ComapnyName LIKE 'varBusName'
On my search page I have two text boxes, one for Business Name and the other for Business Type. When I search by Business Type, everyting is fine. When I search by BOTH, everything is fine.
But when I search by Business Name ONLY, I get a lovely long list of ALL the businesses in my database.
What am I doing wrong?
I've tried putting CompanyName first in the SQL, I've tried changing from LIKE to =, or to LIKE but with wildcards. NOthing.
Please save my sanity! 😉 My polyglot brain thinks everything looks lovely and logical, but my website has other ideas!
Regards,
Rabaab
Although multilingual, I am admittedly NOT literate in SQL or ASP or JavaScript... that's what DW is for, right? Hmmmmmm.....
So my REcordset's Advanced View SQL looks like this:
SELECT ComapnyName, Address1, Address2, City, PostCode, TelNumber, FaxNumber, EMail, WebsitefURL, MapURL, LogoImage, Keyword1, Keyword2, Keyword3, Keyword4, Keyword5
FROM Cardiff
WHERE Keyword1 LIKE 'varBusType' OR Keyword2 LIKE 'varBusType' OR Keyword3 LIKE 'varBusType' OR Keyword4 LIKE 'varBusType' OR Keyword5 LIKE 'varBusType' OR ComapnyName LIKE 'varBusName'
On my search page I have two text boxes, one for Business Name and the other for Business Type. When I search by Business Type, everyting is fine. When I search by BOTH, everything is fine.
But when I search by Business Name ONLY, I get a lovely long list of ALL the businesses in my database.
What am I doing wrong?
I've tried putting CompanyName first in the SQL, I've tried changing from LIKE to =, or to LIKE but with wildcards. NOthing.
Please save my sanity! 😉 My polyglot brain thinks everything looks lovely and logical, but my website has other ideas!
Regards,
Rabaab
