Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 12890

Yielding the desired number of decimal places using the AVG function in t-sql

$
0
0

Hello again.  Confused retired hobby coder having trouble setting up a scalar-valued function to return the desired number of decimal places from a AVG query.

Whenever I run the following script I get the number of decimals I desire:

Using the above I created a scalar-valued function as follows:

Running this function as: SELECT [dbo].[TestHCIPartial] (1,3)  my return is -7.

Can you help me with the function causing it to yield the answer to 6 decimal places?

Thanks and regards, Minuend.


Viewing all articles
Browse latest Browse all 12890

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>