Peter
|
| Posted: 04/03/2002, 10:24 AM |
|
I have a running app with a search generated by the CC_wizzard ("AND" search type) .
When I try to ad a new text search (like keyword) on a new field, no result is returned.
All of the other searches work fine.
Any ideas?
|
|
|
 |
Alex Alexapolsky
|
| Posted: 04/03/2002, 11:23 AM |
|
Are you sure that no record exists that satisfying all input parameters ?
After all , it's AND condition.
|
|
|
 |
Peter
|
| Posted: 04/03/2002, 11:54 AM |
|
OK, I see what you mean, I was wrong.
-- How do I ad an "or" type search field to existing "and" type fileds?
|
|
|
 |
Nicole
|
| Posted: 04/04/2002, 1:34 AM |
|
Peter,
replace "AND" with "OR" in sWhere variable 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);
|
|
|
 |
Peter
|
| Posted: 04/04/2002, 10:55 AM |
|
Nicole, thanks for the answer. I have just one more for you. How do I string
together the "AND" plus "OR" search fields? Foe example, 3 fields that
are "ANDed" together with one that requires an "OR" search.
|
|
|
 |
Nicole
|
| Posted: 04/05/2002, 12:20 AM |
|
Peter,
the solution is to use enhanced replace. I suppose you know the table name field that should be used with OR condition. E.g.:
OR field1 = any value
Thus, replace would be:
PHP
$sWhere = str_replace("AND field1", "OR field1", $sWhere);
$sWhere = str_replace("and field1", "OR field1", $sWhere);
|
|
|
 |
|