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!

Parameters not working...

Status
Not open for further replies.

dBjason

Programmer
Mar 25, 2005
355
US
CR 9

I have a report created which used to work great. Suddenly, my parameters aren't working right and I don't know why.

For example, when I change the Classification parameter to, say, the value "New Construction", I still get all records. Here's a look at the Formula Workshop.

Code:
(if {?Classification} = "ALL" then True
else if {?Classification} <> "ALL" then
{s_BondTracking;1.Classification} = {?Classification}) and
(if {?Obligee} <> "ALL" then
{s_BondTracking;1.Obligee} = {?Obligee}
else
if {?Obligee} = "ALL" then
True) and
(if {?Initiator Name} <> "ALL" then
{s_BondTracking;1.InitiatorName} = {?Initiator Name}
else
if {?Initiator Name} = "ALL" then
True) and
(if {?Security Type} <> "ALL" then
{s_BondTracking;1.SecurityType} = {?Security Type}
else
if {?Security Type} = "ALL" then
True) and
(if {?Initiating Department} <> "ALL" then
{s_BondTracking;1.InitiatingDept} = {?Initiating Department}
else
if {?Initiating Department} = "ALL" then
True) and
{s_BondTracking;1.EffectiveDate} >= {?EffectiveDateBegin} and
{s_BondTracking;1.EffectiveDate} <= {?EffectiveDateEnd} and
{s_BondTracking;1.ExpirationDate} >= {?ExpirationDateBegin} and
{s_BondTracking;1.ExpirationDate} <= {?ExpirationDateEnd} and
(if {?Bond Type} <> "ALL" then
{s_BondTracking;1.BondType} = {?Bond Type}
else
if {?Bond Type} = "ALL" then
True)


The date parameters seem to be working alright, but changing the Obligee, Initiator Name, and the rest return records as if "ALL" had been selected.

What am I doing wrong?

Thanks in advance,
Jason Spelts
 
Hi,
Separate your conditions with parens for easier decoding ( by humans) and to insure the interdependency is correct.


Indentation and parens ( especially with that many If..Then..Else..If..Then..Else
statements )
is essential.

You could have 1 misplaced '(' or 'and' clause that would result in the entire formula evaluating to 'True'




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Your formula looks OK to me, although I would have always used the <> "All" as the first clause. Is this your entire formula? And did you copy and paste it into the thread, or did you recreate it (and potentially fix the error)?

I'm not sure how CR 9 works, but CR XI, it is possible to leave the last used parameter in the parameter selection box when selecting new parameters, so you might check that.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top