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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

3 Parameters that allow multiple values

Status
Not open for further replies.

marydn

Programmer
Mar 26, 2001
152
US
Hi,

I have a report that has 3 parameters that allow multiple values. However, it doesn't seem to filter the data correctly. It seems like the report meets each individual condition and not all the conditions as a whole. I am using Crystal 9.0 and this is my formula:

If {?Site Status} = "All" Then True
Else {rspTest;1.SiteStanding} IN ({?Site Status}) AND

If {?Site Type} = "All" Then True
Else {rspTest;1.SiteType} IN ({?Site Type}) AND

If {?Lease Status} = "All" Then True
Else {rspTest;1.LegalDocumentStatusName} IN ({?Lease Status})

I am sure it is a simple fix, but my brain isn't working today.

Any help would be greatly appreciated!!!!
 
Try enclosing each section in parentheses:

(If {?Site Status} = "All" Then True
Else {rspTest;1.SiteStanding} IN ({?Site Status}))
AND
(If {?Site Type} = "All" Then True
Else {rspTest;1.SiteType} IN ({?Site Type}))
AND
(If {?Lease Status} = "All" Then True
Else {rspTest;1.LegalDocumentStatusName} IN ({?Lease Status}))

-dave
 
A slight rewrite might help to assure SQL pass through:

(
If {?Site Status} <> &quot;All&quot; Then
{rspTest;1.SiteStanding} IN ({?Site Status}))
else If {?Site Status} = &quot;All&quot; Then
true
)
AND
(
If {?Site Type} <> &quot;All&quot; Then
{rspTest;1.SiteType} IN ({?Site Type}))
else {?Site Type} = &quot;All&quot; then
true
)
AND
(
If {?Lease Status} <> &quot;All&quot; Then {rspTest;1.LegalDocumentStatusName} IN ({?Lease Status})
else If {?Lease Status} = &quot;All&quot; then
true
)

-k
 
Vidru's code worked. I got errors with Vampire's. Anyway, it seem to work...THANKS!!!!!!!!!!!!!!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top