Skip to Content
0
Former Member
Feb 11, 2011 at 04:24 PM

format search with operation (+ - * /)

18 Views

HI people, i have this format search working perfectly:

SELECT DISTINCT
CASE WHEN (T3.ITEMCODE= $[$38.1.0] AND T3.PRICE > $[$38.14.number] AND $[$38.14.number]>0)
THEN '1' 
ELSE '0'
END
FROM OCRD T1 
INNER JOIN ITM1 T3 
ON T1.LISTNUM = T3.PRICELIST AND T3.ITEMCODE=$[$38.1.0]
WHERE T1.CARDCODE= $[$4.0.0]

But i need sum a % in $38.14, so i did the next:

SELECT DISTINCT
CASE WHEN (T3.ITEMCODE= $[$38.1.0] AND T3.PRICE > ($[$38.14.number]*1.20) AND $[$38.14.number]>0)
THEN '1' 
ELSE '0'
END
FROM OCRD T1 
INNER JOIN ITM1 T3 
ON T1.LISTNUM = T3.PRICELIST AND T3.ITEMCODE=$[$38.1.0]
WHERE T1.CARDCODE= $[$4.0.0]

But this not work......how can i sum a % ???