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

How do I add an all/* to a report selection formula 1

Status
Not open for further replies.

JoseffB

IS-IT--Management
Mar 25, 2004
3
US
Hello I'm trying to do a report selection based on parameters and I've forgotten how to pass the * field. I may have it right but could someone remind me how to pass this all value. Thanks.



//This will check if the persons name is in the
//Project contact table or not. Since there are only two
//groups if its not a project member we want all of the
//records to pass, so we can sort for the other group later.
//since it's too much for the server if you place the other
//group in the formula too.

if ({GDContact.GDProjectMngr} = {?People})=true then {GDContact.GDProjectMngr} = {?People} else {GDContact.GDProjectMngr} = "*" ;
 
if {GDContact.GDProjectMngr} = "*"
or ({GDContact.GDProjectMngr} = {?People}) then true
 
Try:

(
if not({GDContact.GDProjectMngr} in ["All", "*"]) then
{GDContact.GDProjectMngr} = {?People}
else if {GDContact.GDProjectMngr} in ["All", "*"] then true
)

-k
 
synapesevampire has a feasible idea, but I already got it using:

if ({?People} = "" or {?People} = "ALL") then {Site.SiteNumber} like "*" else ...

Thanks guys

PS I'll try the in ["All", "*"] in another report later and post results.
 
Joseff: As you progress with more advanced record selection formulas you'll find that some combinations will stop passing the SQL to the database, meaning that performance will suffer.

Hence the aforementioned formula uses a fully qualified ELSE condition (repeates the IF), and it makes use of parentheticals, which should exist around every disparate condition.

-k
 
Thank you. I changed it and it is much faster. Agin Thank you lots.

//use Array[1] to check the first entry to see if ALL or *
//is there
(
if not({?People}[1] in ["All", "*"]) then
{GDContact.GDProjectMngr} = {?People} or {RFEngineer.RFEngineer} = {?People}
else if {?People}[1] in ["All", "*"] then true
)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top