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

Parameters not pulling in the correct information 2

Status
Not open for further replies.

M8KWR

Programmer
Aug 18, 2004
864
GB
Hi, hope someone can help.

I have got the following in the record selection formula
Code:
If {?Lead_Code} ='xxxxxxxx'
Then {main_report_test.Lead Code} like '*' 
Else {main_report_test.Lead Code} =  {?Lead_Code} 

and

If {?Company_Guid} ='xxxxxxxx'
Then {main_report_test.Company_Guid} like '*' 
Else {main_report_test.Company_Guid} = {?Company_Guid}

and

If {?Contact_guid} ='xxxxxxxx'
Then {main_report_test.Contact_Guid} like '*' 
Else {main_report_test.Contact_Guid} = {?Contact_guid} 


and 

If {?campaign_code} ='xxxxxxxx'
Then {main_report_test.Campaign_Name} like '*' 
Else {main_report_test.Campaign_Name} =  {?campaign_code} 
and
{main_report_test.Date Called} = {?Date_Range}

The only parameter that seems to want to work is the Date range one.

I am populating the parameters via visual studio, but even when I just run the report, and populate the parameters myself, it giving the same output, which to be honest is wrong.

For example if I use a wide date range, and then set all parameter to "xxxxxxxx", but then the "?campaign_code" to just look for 1 given value, it brings back everything over a given date range, and seems to ignore what I have actually asked for.

?Lead_code and ?campaign_code are discrete with Multiple values, and the ?company_guid and ?contact_guid are just discrete values

this is driving me up the wall, and thanks in advance for any assistance.
 
I suggest you split the tests into a number of separate formulas. Do them as 'boolians', tests without an IF that will return True or False. Then run the report without a selection and see which records are being wrongly included or excluded. Correct the formulas on that basis, after which you can do the selection by referencing those formulas.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
Add parens as follows:

(
If {?Lead_Code} ='xxxxxxxx'
Then {main_report_test.Lead Code} like '*'
Else {main_report_test.Lead Code} = {?Lead_Code}
) and
(
If {?Company_Guid} ='xxxxxxxx'
Then {main_report_test.Company_Guid} like '*'
Else {main_report_test.Company_Guid} = {?Company_Guid}
) and
(
If {?Contact_guid} ='xxxxxxxx'
Then {main_report_test.Contact_Guid} like '*'
Else {main_report_test.Contact_Guid} = {?Contact_guid}
) and
(
If {?campaign_code} ='xxxxxxxx'
Then {main_report_test.Campaign_Name} like '*'
Else {main_report_test.Campaign_Name} = {?campaign_code}
) and
{main_report_test.Date Called} = {?Date_Range}

If it still doesn't work, make sure that 'xxxxxxxx' is in lower case in the picklist.

-LB
 
lb - fantastic - you just made my day.... :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top