Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with 2 Parameters looking at same field

Status
Not open for further replies.

ready4data

Programmer
Apr 9, 2001
18
US
Hi All,
Crystal 8.5 SQL server

These 2 parameters work by themselves. I'm trying to combine them so either one or the other can be used in the report.
1.
(if {?Wildcard Dealer} <> "All"
then {HISTORY.ACCOUNTNAME} like "*" + {?Wildcard Dealer} + "*"
else if {?Wildcard Dealer} = "All"
Then True)

2.
(if {?dealer} <> "_All"
then {HISTORY.ACCOUNTNAME} = left({?Dealer},(InStr({?Dealer}," in ")-1)) and
{ADDRESS.CITY}= Mid({?Dealer},InStr({?Dealer}, " in ")+4)
else if {?dealer} ="_All"
Then True)


If I just use an "and" The parameters don't work
Help would be appreciated.
Thanks,
Scott
 
Since you're using SQL Server you can select Database->Show SQL Query and see what's being passed.

It looks like it's fine with and AND between, however both of the criterias will be used. If you want one OR the other, use an OR.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top