on 10-03-2017 5:26 AM
Hi All,
I have the below statement in CE_PROJECTION, The OR condition is not working.
It works whenever FUNCCUR is YEN, When the FUNCCUR is NTD its not multiplying by 100. Can anyone please let me know if i can use OR condition inside CE_CALC like how written below, If not please correct me .
CE_CALC('IF(("FUNCCUR" = ''YEN'' OR "FUNCCUR" = ''NTD''), ("GLTSL07" * 100.00),"GLTSL07")', decimal(17,2)) AS "GLTSL07_2",
I can use the same with case but just want to learn the mistake in the above code.
Thanks,
Gokul
Looks like a quotation mark mistake.
When you use the double-quotation marks (" ") you're referring to column names, not to values. To specify values, use single quotation marks (' '). For specifying single quotes within single quotes, use the escape mechanism by providing single quote multiple times in a row:
' ''<- these are single quotation marks -> '' '
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lars,
Thanks a lot for your reply.
I have removed a single quote before YEN and NTD, now i am getting an error .
SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near "YEN": line 180 col 26 (at pos 15391)
CE_CALC('IF(("RTCUR" = 'YEN' OR "FUNCCUR" = 'NTD'), ("GLTSL07" * 100.00),"GLTSL07")', decimal(17,2)) AS "GLTSL07_2",
If i add the quotes back its not giving error.
Also just want to add in the below code
"FUNCCUR" - This is double quotes to represent field name
''YEN'' - Two single quotes to denote value - If i change to 1 single quote it gives error.
CE_CALC('IF(("FUNCCUR" = ''YEN'' OR "FUNCCUR" = ''NTD''), ("GLTSL07" * 100.00),"GLTSL07")', decimal(17,2)) AS "GLTSL07_2",
The issue with the above code is, any condition after OR is not working, which means when i pass the record with YEN currency it multiplies by 100, but when i pass a record with NTD its not multiplying with 100. I guess the OR condition is not working. If i switch the YEN and NTD, the alternate condition works fine. Can you please correct if the Syntax is correct .
Thanks,
Gokul
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.