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

Parameter record selection dynamic and static

Status
Not open for further replies.

FrankTWall

Technical User
Jun 29, 2005
20
0
0
AU
Crystal XI, SQL server.

I have a report I need the users to either select a SAP ID or a Customer name.

I have set up dynamic parameter for the customer name and a static parameter for them to enter the SAP ID.

I have a third parameter that allow them to chose whether they want to search by SAP ID OR Customer name.

I can't get the record selection formula/ parameter prompt logic correct to allow this to occur.

I am thinking there has to be a smarter way around this problem. More detail can (obviously) be provided if it is required.
 
Recordselection:

if {?SAP or Customer} = "Customer" then
{table.customer} = {?MyCustomer}
else
{table.sap} = {?MySAP}

They will be prompted for both though.

-k
 
Thanks K,
I had used this formula with success but I was wanting to go to the next "step" where if they were prompted for the SAP ID , that was the only parameter requiring data and vica versa. Using this formula requires the user to enter both.

I think one of the issues is that the customer parameter is dymamic and therefor I can't fudge a value there such as "All" Any other ideas?
 
Played around with this some more. Works well but I will have to educate the users that even though there is a default value appearing they are still searching by either the customer name OR SAP ID. Thanks
 
You can fudge a value of all, you can use a Command object and a UNION,asin:

select "...All..." Customer
UNION ALL
select distinct Customer from customer

It gets a bit trickier though...

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top