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!

OR Statement In Crystal Reports

Status
Not open for further replies.

JMSBR

MIS
Aug 27, 2009
14
GB
Hi

I am trying to write a formula to return results where the following conditions are true:

x = True
y = True
x and y = True

The formula below seems to only return:
x = True
x and y = True

But not just y = True.

// X
(If ("Commercial Property" in {?Events and Mailings}) then {address_Events_and_Mailings.rd_A1_EM_CommProp} = {?Events and Mailing Category} )

or

// Y
(If ("Company Formation and Admin" in {?Events and Mailings}) then {address_Events_and_Mailings.rd_A1_EM_CompanyFormation} = {?Events and Mailing Category} )


It seems to run through the X part of the code and then only look for Y within the results it has found for X.

Hope all that makes sense. Any help would be great as under presure to get the report out and have no idea.

Thanks
 
Are each of the parameters set up to allow multiple values or only discrete values?

-LB
 
Hi lbass

Thanks for your response, I was out of the office yesterday so couldn't get back to you. In answer to your question both parameters are multiple values.

I think I have found the solution but I don't really know why it is working. Can you shed any light on it? I have basically added a check for Nulls as follows:

(If ("Commercial Property" in {?Events and Mailings}) then not isnull({address_Events_and_Mailings.rd_A1_EM_CommProp}) and {address_Events_and_Mailings.rd_A1_EM_CommProp} = {?Events and Mailing Category} )
or
(If ("Company Formation and Admin" in {?Events and Mailings}) then not isnull ({address_Events_and_Mailings.rd_A1_EM_CompanyFormation}) and {address_Events_and_Mailings.rd_A1_EM_CompanyFormation} = {?Events and Mailing Category} )

This is returning the correct data but I would like to know why.

Any ideas appreciated.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top