Hello i have a query that spits out an average value, however this value is soemthing like 2.7897654576 and i just want it to round up to the nearest whole number. Thanks!
Hello i have a query that spits out an average value, however this value is soemthing like 2.7897654576 and i just want it to round up to the nearest whole number. Thanks!
taimysho0 -
You might be able to use the CInt() function to convert into whole number.
Hope this helps,
Jim
thanks for the help!however, it didnt work. do you have another suggestion? thanks
taimysho0 - I gave it a brief test on a test query and it worked just fine. Although, I didn't test on an agg query.
Here's what I used...
new column in QBE - XX: CInt([fieldnamecontainingaverage])
In the interim, I'll test on other agg queries and let you know.
Jim
taimysho0 - When I tested the CInt() function on an agg query, I got an error. However, once I created a new query based on the agg query, the CInt() function as previously used produced the desired results.
Hope this helps,
Jim
If the OP wants the value rounded up, as stated, CInt() won't always do that. It will sometimes round down. So it depends on the actual intent of the poster.
If they always want it rounded up, then something like this should work
RoundUp: IIf([InputNumber]=Int([InputNumber]),[InputNumber],Int([InputNumber])+1)
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007