Hi Gurus,
I need your help guys. Here is my case.
I don't think I have a syntax error in my code but everytime I use the substring operator in the if statement, it always give me the error:
An error occurred while performing operation 'sqlPrepareWithOptions' status='-16'.
UDA-SQL-0358 Line 92: Syntax error near "=".
Below is my code in the filter.
CASE ?P_CriteriaType?
WHEN 'AcctId' THEN ( [Account Id2] in ?P_AcctId?)
WHEN 'PerfDept' THEN ( if (substring(?P_CtryCmp?,1,3) = '760') then ([Division Code] = ?P_DivCode? and [Department] in ?P_PerfDept?) else ([Department] in ?P_PerfDept?))
WHEN 'BPMgrSerCurr' THEN ([Bp Mgr Ser C] in ?P_EmpSer?)
WHEN 'BPMgrSerHist' THEN ([Bp Mgr Ser H] in ?P_EmpSer? )
END
I already tried using 'starts with' and 'like' operator instead of substring in the "if (substring(?P_CtryCmp?,1,3) = '760')" part, but I encountered the same error.
Any response from you will be highly appreciated.
Regards,
tven