I have a query which is retrieving data from a view.
In this query I use the following line:
replace (sum (column1), ',', '.') as amountpaid,
But it looks like the value I get is rounded by 1 decimal. Cause when I sum the values from the view myself than I get for example 100,86. but when I use the query I get 100,9
Can someone tell me how I get a value with 2 decimals with this query.
Thanx.
Why are you replacing Comma with Period? Sounds like the Locale (controlling the numeric format you want to display the amount in) is wrong. If you change Numeric to String then you lose ability to sort etc. and may also have issues with downstream processes trying to re-parse the data. Better to transmit numeric in native format and let the "far end" deal with the display issue.
But of course I have not idea why you are needing to make this change within SQL and there are also good reasons to choose to do that. I just wanted to check that your solution is the best for the actual problem you face.