Forum Moderators: open

Message Too Old, No Replies

ASP, SQL and decimal points

Keeps rounding up!

         

bateman_ap

1:31 pm on Dec 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, bit of a puzzle this one. Have made a SELECT statement that use the Ave function, when run inside Enterprise Manager it outputs as decimals, however in my asp page it appears to round it up to a whole number. Whatever I try I can't get it to use decimals.

sSQL = "SELECT Avg(vote1) AS AvgOffld_vote1, Avg(vote2) AS AvgOffld_vote2, fld_widget_uid FROM tbl_voting GROUP BY fld_widget_uid;"

avevote1 = (Rs("AvgOffld_vote1"))

Response.Write(avevote1)

Staffa

11:43 pm on Dec 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try the following, should give you 2 digits after the dot

avevote1 = formatNumber((Rs("AvgOffld_vote1")), 2)