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

Selecting a Range of Values from Comma Separated List

Status
Not open for further replies.

jemsmom

IS-IT--Management
May 31, 2005
43
US
I am using Crystal 2008 on SQL Server.
The data in column EDG.CURRENT_ICD9_LIST looks like this:

998.89, 780.2, V25.2
525.88
780
780.2
998.89
780.2, 998.89
799.8
998.89, 780.2

I need to select all records that contain EDG.CURRENT_ICD9_LIST in the range of 780.0 to 999.99, but I've only been able to return records with 780.2 when its the first or only code listed by using EDG_CURRENT_ICD9_LIST in "780.0" to "999.99" in the record selection formula.

Thank you

 

This wasn't working until I added the trim function, even though my test data shouldn't need it:

whileprintingrecords;
stringvar array v_ICD9 := split({CurrentICD9List},",");
numbervar x := 1;
numbervar y := 0;

for x := 1 to ubound(v_ICD9)
do
if trim(v_ICD9[x]) in ["780" to "999.99"]
then y := y + 1;
x := x + 1;
y

Then select or show records where this formula > 0.
 
Thank you - this worked perfect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top