Skip to Content
0
Former Member
May 14, 2010 at 02:03 PM

Select Case statement: use startswith or a greater-than as qualifier

2072 Views

Hi everyone! Happy Friday.

I have a formula comprising of a SELECT CASE statement (code below) that identifies certain codes for which no label will be displayed. To shorten the number of codes I have to hard-code, I'd like to use 'startswith' and a greater-than '>' symbol to filter more than one code. However, I'm getting the following error:

"A number, currently amount, boolean, date, time, date-time, or string is expected here" and it highlights the 'startswith' command.

Any ideas what I should do? I don't really want to write it as nested IF/THEN/ELSE statements...

Code:

IF ISNULL({UM_TXPLANWKSHEET_PROC.Diag_Desc})

THEN SELECT {UM_TXPLANWKSHEET_PROC.Code}

CASE 'D0145','D0170A','D0250','D0260','D9430','D9430A':''

CASE STARTSWITH 'D0120':''

CASE STARTSWITH 'D0150':''

CASE STARTSWITH 'D0160':''

CASE STARTSWITH 'D0210':''

CASE STARTSWITH 'D0220':''

CASE STARTSWITH 'D0230':''

CASE STARTSWITH 'D0240':''

CASE STARTSWITH 'D027':''

CASE STARTSWITH 'D0330':''

CASE STARTSWITH 'D11':''

CASE STARTSWITH 'D8670':''

CASE > 'D9999Z':''

DEFAULT:'NO DX SELECTED!!'

ELSE {UM_TXPLANWKSHEET_PROC.Diag_Desc}

Thank you so much!

~Eileen.

Edited by: eileenquintero on May 14, 2010 4:06 PM