Mondeo Posted November 29, 2006 Posted November 29, 2006 I've got this SELECT id, memberID, ((Q + V + C + R + T) / 5) AS TotalScore FROM dbo.csd_MemberFeedbacks The 5 values are integers in the database. The statement runs fine but TotalScore is always returned as a whole number. For example if the values in the DB are 3,4,5,4,3 then I want 3.8 to be returned, but I get 4. How can I fix it so TotalScore in a decimal. Thanks Quote
MrPaul Posted November 30, 2006 Posted November 30, 2006 Convert(...) Try the CONVERT function: SELECT id, memberID, (CONVERT(real, Q + V + C + R + T) / 5.0) AS TotalScore FROM dbo.csd_MemberFeedbacks Good luck :cool: Quote Never trouble another for what you can do for yourself.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.