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

Problem with formula's in parameters

Status
Not open for further replies.

Jonesxx

Technical User
Jul 14, 2004
71
GB
Hi,

I’m using Crystal 8.5,

I have four parameters on a report where users select their options via the parameter prompt screen.

I would like users to have flexibility when responding to the parameter prompts e.g. entering data in the {?Team} and {?Completed Sale} prompts only, while ignoring the {?EndDate} and {?Service Team} parameter prompts. At the moment if data is not selected in all four parameters the report brings back blank information. I need all four parameters to be on the report as there will be times when the users need to run the report based on all four parameter criteria’s. Below is the formula I am using, taken from Report/Edit selection formula/ Record:

(if {?Team} <> "ALL" then {Sales.User} = {?Team} else if {?Team} = "ALL" then true) and{Sales.Date} = {?EndDate} and
if {?Completed Sale} = "Other" then {Sales.Number} in ["W", "I", "M"] else {Sales.Number} = {?Completed Sale} and
(if {?Service Team} <> "ALL" then {Sales.UVF} = {?Service Team} else if {?Sales Team} = "ALL" then true)


Please help.

Thanks v m
 
Add a default for {?EndDate} of 9/9/9999, and then change your formula to:

(
if {?Team} <> "ALL" then
{Sales.User} = {?Team} else
if {?Team} = "ALL" then
true
) and
(
if {Sales.Date} <> date(9999,9,9) then
{Sales.Date} = {?EndDate} else
if {Sales.Date} = date(9999,9,9) then
true
) and
if {?Completed Sale} = "Other" then
{Sales.Number} in ["W", "I", "M"] else
{Sales.Number} = {?Completed Sale} and
(
if {?Service Team} <> "ALL" then
{Sales.UVF} = {?Service Team} else
if {?Sales Team} = "ALL" then
true
)

Be sure to have a default of "ALL" in your list of values for {?Service Team} and {?Team}.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top