I need to calculate an average of values in one field. I used the correct syntax 'Select AVG(fieldname) etc. '. However, it does not work. Is there any limitations in terms of how the database should have the information organized in order for me to be able to return the Average of values.
I need to calculate an average of values in one field. I used the correct syntax 'Select AVG(fieldname) etc. '. However, it does not work. Is there any limitations in terms of how the database should have the information organized in order for me to be able to return the Average of values.
whats the datatype of field used inside AVG? it may be that it was integer field so that result got implicitly converted to int
try AVG(field * 1.0) instead of AVG(field) and see if it gives you correct result
------------------------------------------------------------------------------------------------------ SQL Server MVP http://visakhm.blogspot.com/