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

Lookup based on Parameter 1

Status
Not open for further replies.

smilbert

IS-IT--Management
Aug 28, 2006
36
US
I'm using CRXI and MS SQL 2000

Is there a formula that allows you to lookup a value in a table based on a Parameter?

I'd like to look in the tbGroups table and lookup the GroupDescription based on the GroupID (where GroupID = the Parameter)
 
Is this for the purpose of displaying the description related to a selected parameter value? You can either create a formula that hard codes the values as in:

numbervar i;
numbervar j := ubound({?parm});
stringvar display;

for i := 1 to j do (
display := display +
(
if {?parm} = value1 then "Boston" else
if {?parm} = value2 then "New York" else
if {?parm} = value3 then "Los Angeles"
) + ", ");
left(display,len(display)-2);

Or, you can insert a subreport that uses tblGroups and displays the description in the detail section. Create the same parameter in the subreport, add a record selection formula to the sub like:

{tblGroups.value} = {?Parm}

and link the sub to the main on the parameters, by using the dropdown in the lower left of the subreport linking screen.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top