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

Record Selection Formulas

Status
Not open for further replies.

Wallegator

Programmer
Jan 3, 2001
58
0
0
US
I have two parameters in a report: Vendor Number and Job. If I select a Vendor number and a Job the report returns the correct grouped results. If I select one or the other the report does not include all of the records. What am I doing wrong? I'll paste my record selection formula below. Do I need to have a group selection formula as well? What is the difference between the two?

(
If {?VendorNumber}<>&quot;All&quot; Then {APM_MASTER__DISTRIBUTION.Vendor}={?VendorNumber}
Else if {?VendorNumber}=&quot;All&quot; Then
True
)
And
(
If {?Job}<>&quot;All&quot; Then{APM_MASTER__DISTRIBUTION.Job} Like {?Job} & &quot;*&quot;
Else if {?Job}=&quot;All&quot; Then
True
)
 

Try this...

If {?VendorNumber}<>&quot;All&quot; AND {?Job}<>&quot;All&quot; Then {APM_MASTER__DISTRIBUTION.Job} Like {?Job} & &quot;*&quot; AND {APM_MASTER__DISTRIBUTION.Vendor}={?VendorNumber}
Else if {?VendorNumber}=&quot;All&quot; AND {?Job}=&quot;All&quot; Then
True
Else if {?VendorNumber}= &quot;All&quot; then
{APM_MASTER__DISTRIBUTION.Job} Like {?Job} & &quot;*&quot;
Else
{APM_MASTER__DISTRIBUTION.Vendor}={?VendorNumber}

hth,
Matt
 
Did you set the default value for the parms to &quot;All&quot;?

This is standard stuff, so either you're using a range parm or you didn't set the default value.

Your method is cleaner than Matt's and will pass SQL to the database, whereas his is suspect, at any rate, the problem lies elsewhere.

-k
 
synapsevampire is in a bad mood today, so I'm gonna let that one go!

Try my formula. If it doesn't work, it is something else.

I doubt it is the default value...unless you didn't pick the parameter value you meant to.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top