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 to make data selection based on user input 1

Status
Not open for further replies.

lwanalyst

Technical User
Jul 8, 2002
28
US
Hello,

I currently have a prompt called Market, which accepts the string TX or OK. If a user inputs TX then it the report should pull records where the location code field is like TX* to capture all records beginning with TX, and if they type in OK, it should only pull records that begin with OK*, however my current formula doesn't work.
 
You forgot to post your current formula.

But it should look something like this:

{Database.Market} like {?Market}

Depending on your database, '*' or '%' will be the default partial wildcard.

Naith
 
Sorry,
this how I reference it in my record selection...

{@MarketSelect} like {?Market}

but I get an error saying a string is required where {marketSelect} is. Why? and What should I put here then?

and this is the formula that has been created to define the user input entry... {@MarketSelect}
If {?Market} ="TX" then {tblOriginal_Admits2_Final.PATIENT_CLIENT_NAME} like "TX-*" else if {?Market}= "OK" then {tblOriginal_Admits2_Final.PATIENT_CLIENT_NAME} like "OK*" else {tblOriginal_Admits2_Final.PATIENT_CLIENT_NAME} like "TX-*"

This the formula {@market}, that my report is grouped by. I do this because there are several naming conventions that I want rolled into 1 naming convention...
tblOriginal_Admits2_Final.PATIENT_CLIENT_NAME} like "TX-San*" then "TX-SAN ANTONIO" else if {tblOriginal_Admits2_Final.PATIENT_CLIENT_NAME}like"TX-Dallas*" then "TX-DALLAS" else if{tblOriginal_Admits2_Final.PATIENT_CLIENT_NAME}like"TX-Austin*" then "TX-AUSTIN" else if{tblOriginal_Admits2_Final.PATIENT_CLIENT_NAME} like "TX-Houston*" then "TX-HOUSTON" else if{tblOriginal_Admits2_Final.PATIENT_CLIENT_NAME} like "OK-Oklahoma City*" then "OK-Oklahoma City"else if{tblOriginal_Admits2_Final.PATIENT_CLIENT_NAME} like "OK-Tulsa*" then "OK-Tulsa"

 
Your record selection formula shoul dbe just:
---------------
{@MarketSelect}
---------------

because it is already a TRUE/FALSE expression.

hth,
- Ido CUT & Visual CUT: e-mailing, exporting, bursting, distribution, and scheduling of Crystal Reports:
 
I knew it was simple. I guess I overthought the whole process.

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top