I have scores being submitted by three users and would like to display the average score to the nearest tenth’s place. Currently, I am using the query:
SELECT AVG(score) as AverageScore
FROM PoemScores
WHERE poemID = #qGetPoems.poemid#
I am able to output AverageScore, but only as a whole number using #getScore.AverageScore#. How can I output the average score in the format n.n? The database is MSSQL Server 2008.
Depending on your database engine, you probably just need to cast the score as a decimal or a float before averaging it.
possible mysql approach:
possible mssql approach: