1

I have this query

SELECT COALESCE(ROUND(discount_rate * 0.1, 2), '0') AS discount_amount,
COALESCE(discount_rate, 0) AS discount_rate 
FROM discount_rate 

and it is giving me the following error when execute throught my application code however it works fine on SQLManagerLite Query panel.

Error Code (80007) ERROR: function round(double precision, integer) does not exist
  Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Elvin
  • 2,131
  • 8
  • 23
  • 25
  • use `ROUND(discount_rate::numeric * 0.1, 2)` – Mike T Nov 15 '13 at 04:07
  • @Mike: No I actually use ::Numeric in the code query and it says you need explicit casting and when I did SELECT COALESCE(ROUND(CAST (discount_rate * 0.1) AS NUMERIC, 2), '0') AS discount_amount, COALESCE(discount_rate, 0) AS discount_rate FROM discount_rate it gives error Error Code (80007) ERROR: syntax error at or near ")" however i am unable to figure out the last error – Elvin Nov 15 '13 at 04:15

0 Answers0