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

Parameter issue in the Formula

Status
Not open for further replies.

siri98

Programmer
Jul 9, 2007
3
US
Given below is the formula that I am using in Crystal XI. I am getting the data only if I provide all the parameters. Even if one of the parametesr is blank, I am getting the report as blank.

What I am trying to achieve is, even if I give one parameter as blank, I should be able to get the data for the rest the parameters.

Can anyone help or suggest me to solve my issue?


{LSCMCONTRACT_child.CREATEDATE} >= {?Startdate} and {LSCMCONTRACT_child.CREATEDATE} <={?EndDate}
and
(
(if isnull ({?Commodity}) then {LSCMCONTRACT_child.COMMODITY}={LSCMCONTRACT_child.COMMODITY} else {LSCMCONTRACT_child.COMMODITY}={?Commodity})
and (if isnull({?Jurisdiction}) then {LSCMCONTRACT_child.JURISCODE}={LSCMCONTRACT_child.JURISCODE} else{LSCMCONTRACT_child.JURISCODE}={?Jurisdiction})
and (if isnull({?ProductType}) then {LSCMPRODUCT.PRODUCTID}={LSCMPRODUCT.PRODUCTID}else {LSCMPRODUCT.PRODUCTID}={?ProductType} )
and (if isnull({?SalesExecutive}) then {EXESALESREP.SALESREPLASTNAME}={EXESALESREP.SALESREPLASTNAME} else {EXESALESREP.SALESREPLASTNAME}={?SalesExecutive})
)
 
Hi,
Crystal is not always happy when treating NULLs ( and blanks are not always NULL ) - also I am not sure what you want to accomplish with
Code:
{LSCMCONTRACT_child.COMMODITY}={LSCMCONTRACT_child.COMMODITY}

Since it seems to be a meaningless comprison - use the boolean TRUE instead, if it does not matter what value of {LSCMCONTRACT_child.COMMODITY} is returned.

Try setting a default value for each parameter and use that in your test -

Like
Code:
(If {?Commodity}= 'ANY' then TRUE else {LSCMCONTRACT_child.COMMODITY}={?Commodity})




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top