Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Search using two criteria, using ASP/Access... argh!

New Here ,
Aug 07, 2006 Aug 07, 2006
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
TOPICS
Server side applications
258
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 07, 2006 Aug 07, 2006
Try this,
AND ComapnyName LIKE 'varBusName'
Dave

"Rabaab_m" <webforumsuser@macromedia.com> wrote in message
news:eb8i4u$5up$1@forums.macromedia.com...
> 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
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 08, 2006 Aug 08, 2006
LATEST
Yep, tried that too... no joy.

Oddly, when I leave BOTH text fields blank and hit the submit button, it gives me again ALL the database results,
so it seems the results page is ignoring the Business Name text box, or else treating it like a wildcard.

Any ideas anyone???

Rabaab




Try this,
AND ComapnyName LIKE 'varBusName'
Dave

"Rabaab_m" <webforumsuser@macromedia.com> wrote in message
news:eb8i4u$5up$1@forums.macromedia.com...
> 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
>





Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines