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!

Need a formula for a parameter

Status
Not open for further replies.

butkus

MIS
Sep 4, 2001
114
US
I have no idea how to begin this one - but this is what I'd like to do.

Present the user with a parameter and accept input of either 147 / 167 / 299 / 331 / 390 / 403 / CC4 / all

"all" is were the formula comes in (in a perfect world, this entry would run the report against all of the other potential entries)
 
Create a string type parameter field and prepopulate it with:

147 167 299 331 390 403 CC4 all

Now create a record selection criteria akin to::

If {?MyParameter} in ["147", "167", "299", "331", "390", "403", "CC4"] then
{MyTable.MyField} = {?MyParameter}
else
if {?MyParameter} = "all" then
not({MyTable.MyField} in ["147", "167", "299", "331", "390", "403", "CC4"])

We may have to use a formula for part of this to assure pass through SQL.

-k kai@informeddatadecisions.com
 
If 'all' is supposed to get all the other potential entries as well as your predefined values, as opposed to instead of your predefined values, then change the above formula to:

If {?MyParameter} in ["147", "167", "299", "331", "390", "403", "CC4"] then
{MyTable.MyField} = {?MyParameter}
else
if {?MyParameter} = "all" then True;

Naith
 
Thanks to you both,

I came up with a Select Case statement that did the trick. Not sure if its the best or most efficient approach - but it works. Y'all did give my good ideas for future projects though - thanks again.
What I came up with :
Select {?Court Number}
Case "147":
{InJail.DM_CRT_DIV} = "147"
Case "167":
{InJail.DM_CRT_DIV} = "167"
Case "299":
{InJail.DM_CRT_DIV} = "299"
Case "331":
{InJail.DM_CRT_DIV} = "331"
Case "390":
{InJail.DM_CRT_DIV} = "390"
Case "403":
{InJail.DM_CRT_DIV} = "403"
Case "CC4":
{InJail.DM_CRT_DIV} = "CC4"
Default:
{InJail.DM_CRT_DIV} = {InJail.DM_CRT_DIV}
;


James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top