Link to home
Start Free TrialLog in
Avatar of Michelle Aycoth
Michelle Aycoth

asked on

Crystal Reports - Record selection filter - formula editor

I am actually using I-net report, but they are interchangeable.   I-net uses JDBC connections where as Crystal uses ODBC connections.

I'm having an issue with my SQL statement for record selection.   The original formula was:
{TABLE.LOB_CODE} in ["Z", "E"] and
date({TABLE.SCAN_TMSTMP}) = currentdate - 1 and
NumericText({TABLE.DOC_TYPE_CODE}) and
not(isnull({TABLE.DOC_TYPE_CODE}))

However, I-net does not know what to do with the function NumericText().   So I attempted to use this:
{TABLE.LOB_CODE} in ["Z", "E"] and
(date({TABLE.SCAN_TMSTMP}) = currentdate - 1) and
(not(isnull({TABLE.DOC_TYPE_CODE}))) and
(If (left({TABLE.DOC_TYPE_CODE},1) = '0')
then ({TABLE.DOC_TYPE_CODE} = Right({TABLE.DOC_TYPE_CODE}, (len({TABLE.DOC_TYPE_CODE})-1))
else IF(left({TABLE.DOC_TYPE_CODE}, 2) = '00')
then ({TABLE.DOC_TYPE_CODE} = Right({TABLE.DOC_TYPE_CODE}, (len({TABLE.DOC_TYPE_CODE})-2)))

My attempt is to eliminate the leading zeros on a numeric field.... which I am guessing the first person did by converting the number to text?   At any rate, I continually get a syntax error.... EXPECTED ";" here: line 9 column1.   this where the ESLE IF statement begins.

I've tried adding the ";" as suggested, but get another error stating expression expected.

Suggestions?   I'm at my rope's end.    Thanks, Michelle
SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michelle Aycoth
Michelle Aycoth

ASKER

Thank you both, I was able to resolve it using formulas converting to string and then adding specified sort order on the new formulas for the groups.  Long way around to get I-net to work... but it does.   Thx again.