How round the result of an expression

W

Woody

I have a function with code like the following:

SELECT InvNum, InvRate, Elapsed, ROUND((InvRate * Elapsed), 2) AS Charged

The result of this query shows the Charged column with four decimals and
what I want is two. Setting format on the field doesn't work. Anyone know
how to do this? This is with SQL Server 2005. InvRate is a money field and
Elapsed is a decimal (19,4). I supposed it needed to be 19,4 but maybe
that's the problem. Does it need to be 19,2? I supposed I needed the four
decimals for greater accuracy, but maybe I am mistaken, the user is neer
going to enter more decimal places than two. Am I using the Round function
correctly? If so, I don't understand why I am getting four decimal places.

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top