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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I do not want my dividend to be rounded

Status
Not open for further replies.

czarjosh

Technical User
Jul 14, 2002
79
US
I have written a query that does a simple division funtion, however the results always round down. I would like it to show the value in its entirity. The SQL is:

SELECT Registration.[Room Type] AS Label, Count(Registration.[Room Type]) AS [Count], [Count]\[RoomValue] AS Dividend
FROM Registration INNER JOIN RoomType ON Registration.[Room Type] = RoomType.[Room Type]
GROUP BY Registration.[Room Type], RoomType.RoomValue;

and my reults are:

Label Count Dividend
Double 171.00 85
Double w/ Rollaway 25.00 8
Other 23.00 23
Single 19.00 19
Suite 3.00 3
 
I'm not sure to understand well the issue.
Maybe replace this:
[Count]\[RoomValue]
By this:
[Count]/[RoomValue]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
no the division is working. it is just not showing the decimal, thus rounding down 171.00/3=85.5 but i only see 85
 
\ is the operator for integral division, so the result is as expected.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top