on 09-08-2022 8:06 AM
Hi experts
i want this code work i don't know how to use "OR" Fuction
CASE WHEN T1."LineTotal"=0 THEN 0 ELSE (-1)*T0."DiscSum" OR CASE WHEN T0."CANCELED"='C' THEN T0.'DiscSum" ELSE T0."DiscSum" END AS "Discount Amount"
Hi
You have to use Union as below to get different case for a single column.
Below is the example. alter it according to your requirement.
SELECT
CASE WHEN T1."LineTotal"=0 THEN 0 ELSE (-1)*T0."DiscSum" END AS "Discount Amount"
WHERE T1."LineTotal"= 0
UNION
SELECT
CASE WHEN T0."CANCELED"='C' THEN T0.'DiscSum" ELSE T0."DiscSum" END AS "Discount Amount"
WHERE T0."CANCELED"='C'
Regards,
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
9 | |
9 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.