Our life is an apprenticeship to the truth that around every circle another can be drawn; that there is no end in nature, but every end is a beginning, and under every deep a lower deep opens.
Friday, March 13, 2009
How to calculate Average with 2 decimal places in SQL Server
I have following query to find average in SQL Server select top 10 cast(avg(cast(DATEDIFF(day, createdate, getdate()) as decimal)) as decimal(18,2)) as avgDays from tblTemp Is there any optimized way to find average upto two decimal places? Thanks.