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

select case statement in formula

Status
Not open for further replies.

sorchard2000

Technical User
Aug 3, 2004
57
US
Crystal 8.5
SQL server

On a select statement, can I add LIKE into the statement so that I can use a wild card for a search?

Here's what I have:

Select {psmpro.proname_abbr}
Case 'MVR', 'CABG', 'AVR' : 'Open Hearts'
Case 'ACD*', 'KYPH*', 'LUMBAR*', 'POSCER', 'POSTLUMBAR' : 'Spinal Procedures'
default: 'Error not defined'

This results in it NOT finding any procedures with ACD in the abbreviation.
I want it to find any procedure with ACD in the procedure abbreviation and call it a "Spinal Procedure".
How can I do this?

Thanks all you smart people!

 
Convert to an IF:

if {psmpro.proname_abbr} in ['MVR', 'CABG', 'AVR'] then
'Open Hearts'
else
if {psmpro.proname_abbr} like 'ACD*'
or
{psmpro.proname_abbr} like 'KYPH*'
or
{psmpro.proname_abbr} like 'LUMBAR*'
or
{psmpro.proname_abbr} in ['POSCER', 'POSTLUMBAR'] then
'Spinal Procedures'
else
'Error not defined'

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top