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

Help with OR statement

Status
Not open for further replies.

richardtm

IS-IT--Management
Jan 7, 2005
12
0
0
US
Using Crystal 8.5:

I want to retrieve data where one of two events occurred. Right now my formula looks like this:

{casemain.is_casecanceled} = 0 and
{casemain.actcase_start_datetime} in {?frmdt} to {?todt} and
{casereslist.resrole_id} = 25.00 or {ancilservice.ancilservice_id} = 6.00

My report is only pulling those records where the resrole_id = 25. It is ignoring those records with a ancilservice_id = 6. How can I get the report to select those records where either of those events occur (not just the resrole_id = 25)?

Thanks for any help!!!




 
Use parentheticals properly to clearly identify what you want:

(
{casemain.is_casecanceled} = 0
)
and
(
{casemain.actcase_start_datetime} in {?frmdt} to {?todt}
)
and
(
{casereslist.resrole_id} = 25.00 or {ancilservice.ancilservice_id} = 6.00
)

I'm assuming what you want here as it can be read different ways.

Anyway, you get the idea, clearly identify each area.

-k
 
How are the tables linked? Also, it depends on where you put the parenthesis

Code:
[b][COLOR=red]([/color][/b]
{casemain.is_casecanceled} = 0 and
{casemain.actcase_start_datetime} in {?frmdt} to {?todt} and 
{casereslist.resrole_id} = 25.00
[b][COLOR=red])[/color][/b]
 or {ancilservice.ancilservice_id} = 6.00

is different from

Code:
{casemain.is_casecanceled} = 0 and
{casemain.actcase_start_datetime} in {?frmdt} to {?todt} and 
[b][COLOR=red]([/color][/b]
{casereslist.resrole_id} = 25.00 or {ancilservice.ancilservice_id} = 6.00
[b][COLOR=red])[/color][/b]

 
You can also move part of the test to a formual field.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top