Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert a number value to decimal

Status
Not open for further replies.

ciarra41

Technical User
Sep 11, 2006
116
US
I need to convert numbers or currency like below to two decimal places. It's not working in the properties either.


I'm getting this:
27.3333333333333
55.0833333333333
null
91.7875
0
8

But I need this:
27.33
55.08
0.00
91.78
0.00
8.00

SELECT Master.rep, Sum([correct total]/12) AS TTl
FROM Master
GROUP BY Master.rep
 
If you want the value expressed with two decimal places, you should use the Round() function. Try something like:

Code:
SELECT Master.rep, Round(Sum([correct total]/12),2) AS TTl
FROM Master
GROUP BY Master.rep

Duane
Hook'D on Access
MS Access MVP
 
You seem to be truncating ... not rounding.

91.7875 would round to 91.7[red]9[/red] but you want 91.7[red]8[/red].

Try
Code:
SELECT Master.rep, 
       Int(Sum([correct total]/12)*100.0)/100.0 AS TTl
FROM Master
GROUP BY Master.rep
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top