CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 AND and OR Operators in Grid & Search

Print topic Send  topic

Author Message
Gaetano
Posted: 01/24/2002, 12:32 PM

I need to do a Search & Grid in two pages

I've two criteria on the form that filter the table on the same field with an OR operator.

For example: the grid contains the fields Name1, Name2
The table has a field Name

I Need to filter the data in this way
select Name from table where Name like ('%Name1') OR Name like ('%Name2')

I've seen the post http://www.gotocode.com/disc_viewt.asp?mid=643 but it's not good for me because it apply to the case of AND or OR for two different fields of the table. I need to apply the OR on the same field of the table.

Any idea?

Thanks
Gaetano
Nicole
Posted: 01/25/2002, 2:51 AM

Gaetano,
you may replace generated AND condition with OR in Open event of result Grid form. E.g.:
ASP
sWhere = replace(sWhere, "AND", "OR")
sWhere = replace(sWhere, "and", "OR")

PHP
$sWhere = str_replace("AND", "OR", $sWhere);
$sWhere = str_replace("and", "OR", $sWhere);

   


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.