Filter numbers based on formula.

I need to select only certain codes.  The codes are indicated in a formula that takes into account more than one field.

I only want codes that go from 3001 to 3999.  Attached is the report, and below are the two formulas.  

The first formula takes into account null values and formats the ID and name of the field.
if {CLARITY_TDL_TRAN.DETAIL_TYPE} in [21,23] then
  (if isnull({CLARITY_TDL_TRAN.MATCH_PROC_ID}) then "*** NO PROCEDURE ***"
    else if isnull({MATCH_PROCEDURE.PROC_ID}) then "*** UNKNOWN PROCEDURE ***"
    else if isnull({MATCH_PROCEDURE.PROC_CODE}) then "*** No Code for internal procedure # " & ToText({MATCH_PROCEDURE.PROC_ID},0,"") & " ***"
    else if isnull({MATCH_PROCEDURE.PROC_NAME}) then {MATCH_PROCEDURE.PROC_CODE}
    else ToText({MATCH_PROCEDURE.PROC_CODE}) & " - " & {MATCH_PROCEDURE.PROC_NAME}
  )
else
  (if isnull({CLARITY_TDL_TRAN.PROC_ID}) then "*** NO PROCEDURE ***"
    else if isnull({PROCEDURE.PROC_ID}) then "*** UNKNOWN PROCEDURE ***"
    else if isnull({PROCEDURE.PROC_CODE}) then "*** No Code for internal procedure # " & ToText({PROCEDURE.PROC_ID},0,"") & " ***"
    else if isnull({PROCEDURE.PROC_NAME}) then {PROCEDURE.PROC_CODE}
    else ToText({PROCEDURE.PROC_CODE}) & " - " & {PROCEDURE.PROC_NAME}
  )

The second formula is used in the record select to indicate which procedures should be included in the report.

{CLARITY_TDL_TRAN.POST_DATE} in {@Interpreted Start Date} to {@Interpreted End Date} and
((not(isnull({CLARITY_TDL_TRAN.SERV_AREA_ID})) and {CLARITY_TDL_TRAN.SERV_AREA_ID} = {?Service Area ID}) or {?Service Area ID} = 0) and
(((not(isnull({DEPARTMENT.REV_LOC_ID}) ) and (totext({DEPARTMENT.REV_LOC_ID}, 0, "") in {?Location}) or {?Location}= "0"))) and
({@Procedure Code} startswith "300")

Unfortunately, this formula includes procedure code 3000, which I need filtered OUT of the report.  

Can someone tell me how to build the record select formula so that only 3001 to 3999 are in the report?
ExpExchSample.rpt
Becky EdwardsEpic Clarity DeveloperAsked:
Who is Participating?
 
mlmccCommented:
Does this work

({@Procedure Code} IN "3001" to "3999")

mlmcc
0
 
Becky EdwardsEpic Clarity DeveloperAuthor Commented:
Perfect!!!!! Thank you so much!!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.