CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Multiple Selections in Option List do not OR they only AND together.

Print topic Send  topic

Author Message
GRQNET
Posted: 05/27/2004, 11:22 AM

Hi I am attempting to create a List Box that allows the user to do a muliple
selection of towns and be able to display any of the results search for.
Right now my code just does an AND function. That is if I select the towns
Greenlawn and Melville, the search results show nothing instead of BOTH
towns.
I am using ASP.

Here is my SQL code for the table.

SELECT DISTINCT c21aalistings.new_bath_tot, c21aalistings.ml_link,
c21aalistings.bath_full, c21aalistings.bath_half, c21aalistings.bath_tot,
c21aalistings.br, c21aalistings.constr, c21aalistings.county,
c21aalistings.lp_dol, c21aalistings.ml_num, c21aalistings.sd_name,
c21aalistings.sd_num, c21aalistings.style, c21aalistings.taxes,
c21aalistings.town FROM c21aalistings LEFT JOIN NassauTowns ON
c21aalistings.town = NassauTowns.town
WHERE (NassauTowns.town IN ('{s_nassautown}') OR ('{s_nassautown}'='0') )


Thanks.

Anthony.


GRQNET
Posted: 05/27/2004, 11:38 AM

I notice that if I change the code to what the CodeCharge ExamplePack says.

SELECT DISTINCT c21aalistings.new_bath_tot, c21aalistings.ml_link,
c21aalistings.bath_full, c21aalistings.bath_half, c21aalistings.bath_tot,
c21aalistings.br, c21aalistings.constr, c21aalistings.county,
c21aalistings.lp_dol, c21aalistings.ml_num, c21aalistings.sd_name,
c21aalistings.sd_num, c21aalistings.style, c21aalistings.taxes,
c21aalistings.town FROM c21aalistings LEFT JOIN NassauTowns ON
c21aalistings.town = NassauTowns.town

WHERE (NassauTowns.town IN ({s_nassautown}) OR ('{s_nassautown}'='0') )

(I removed the quotes around the first {s_nassautown} )

I get the following error:

Form: Grid c21aalistings

Error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters.
Expected 2. (Microsoft OLE DB Provider for ODBC Drivers)

Anthony

==========================================================
"GRQNET" <Webmaster@grq.net> wrote in message
news:c95bln$kov$1@news.codecharge.com...
> Hi I am attempting to create a List Box that allows the user to do a
muliple
> selection of towns and be able to display any of the results search for.
> Right now my code just does an AND function. That is if I select the
towns
> Greenlawn and Melville, the search results show nothing instead of BOTH
> towns.
> I am using ASP.
>
> Here is my SQL code for the table.
>
> SELECT DISTINCT c21aalistings.new_bath_tot, c21aalistings.ml_link,
> c21aalistings.bath_full, c21aalistings.bath_half, c21aalistings.bath_tot,
> c21aalistings.br, c21aalistings.constr, c21aalistings.county,
> c21aalistings.lp_dol, c21aalistings.ml_num, c21aalistings.sd_name,
> c21aalistings.sd_num, c21aalistings.style, c21aalistings.taxes,
> c21aalistings.town FROM c21aalistings LEFT JOIN NassauTowns ON
> c21aalistings.town = NassauTowns.town
> WHERE (NassauTowns.town IN ('{s_nassautown}') OR ('{s_nassautown}'='0') )
>
>
> Thanks.
>
> Anthony.
>
>
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.