CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 My Multiple Selection ListBox is performing an AND instead of an OR function.

Print topic Send  topic

Author Message
GRQNET
Posted: 06/10/2004, 6:47 AM

Hi, I'm a newbe to programming.

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') )

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

Thanks in advance for the help!!


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.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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