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

Need an "ALL" value in a parameter for Record Selection 1

Status
Not open for further replies.

BHaines

Programmer
May 29, 2003
100
US
I'm a beginner who has only had a crash course in CR 10 and is working on CR 8.5. The report I am writing has a parameter to select which sites you wish records from based on a field with that data in it, but I also want to add an "ALL" option so that they don't have to manually add all the sites. I looked at another report that has this functionality, but my trying to mod my code to get the same results only ends up with a blank report with no data pulled.

My formula code in the Select Expert:

({S_CUST_SURVEY.LAST_UPD} = {?WhatDates} ) and
(If ({?WhatSites} = "ALL" then TRUE
else {S_CONTACT.SITE} = {?WhatSites})

Any help is much appreciated.

 
You can alter it to this:

({S_CUST_SURVEY.LAST_UPD} = {?WhatDates}) and
(
if ({?WhatSites} <> "ALL" then
{S_CONTACT.SITE} = {?WhatSites}
else if ({?WhatSites} = "ALL" then
true
)


Or you can write it this way:

({S_CUST_SURVEY.LAST_UPD} = {?WhatDates}) and
({?WhatSites} = "ALL" or {S_CONTACT.SITE} = {?WhatSites})



~Brian
 
Neither of those seem to work. The former is giving a "The ) is missing" error and the latter again generates a blank report with no data.
 
Try:

Code:
({S_CUST_SURVEY.LAST_UPD} = {?WhatDates} ) and
(If ({?WhatSites} <> "ALL" then 
{S_CONTACT.SITE} = {?WhatSites})

let me know if it doesn't work
 
Still getting a blank report result with 0 records returned.
 
The first one had an extra parenthesis, should have been this:

({S_CUST_SURVEY.LAST_UPD} = {?WhatDates}) and
(
if ({?WhatSites} <> "ALL" then
{S_CONTACT.SITE} = {?WhatSites}
else if {?WhatSites} = "ALL" then
true
)


What do you get if you just run the report using this in the criteria:

({S_CUST_SURVEY.LAST_UPD} = {?WhatDates})

Do you get any data back on the report?

~Brian
 
Thank you! That first one worked after I took out one parenthesis! Thank you so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top