Home > Ms Access > Ms Access Round Function Not Working

Ms Access Round Function Not Working


For example, open the Immediate Window (Ctrl+G), and enter: ? Examples: 0.5 -> 0 1.5 -> 2 2.5 -> 2 3.5 -> 4 4.5 -> 4 5.5 -> 6 6.5 -> 6 7.5 -> 8 8.5 -> 8 9.5 -> 10 You currently have 0 posts. Shouldn't the number round to 404.69?? Check This Out

No offence intended! msgbox ROUND(2068.1550000000,2) and got 2068.16 in both cases. There is a Decimal Places property for fields in a table/query and for text boxes on a form/report. Following the nearest even digit algorithm, I expect Round(1.245, 2) = 1.24 (4 is the nearest even digit) - am I right ?

Ms Access Decimal Places

Thanks for the support! 0 LVL 51 Overall: Level 51 MS Access 12 Message Expert Comment by:HainKurt2012-03-02 Comment Utility Permalink(# a37673031) change Sum(Round([Amount],2)) AS Round >>>> Sum(Round(qryIndirectLabor.Amount,2)) AS Round in Round([Amount]*0.015,2) Amount = a $ Value ie ($234.00) which i then get 1.5% of this figure and round to 2 decimal places. Similar topics Where is the correct round() method?

Subscribe to our monthly newsletter for tech news and trends Membership How it Works Gigs Live Careers Plans and Pricing For Business Become an Expert Resource Center About Us Who We To start viewing messages, select the forum that you want to visit from the selection below. Find More Posts by namliam

09-22-2009, 09:56 AM #9 jjturner Newly Registered User Join Date: Aug 2002 Location: Boston, MA Posts: 387 Thanks: 0 Thanked Ms Access Round To Nearest 100 You can replace Expr1 with a column name that is more meaningful.

Sir you have made my day - First let me say I don't really know Visual Basic from a hole in the ground - but I followed your advise and it Access Vba Round No, create an account now. A value in this field is 39.553. On Error Resume Next ScaledValue = Round(CDec(Value) * Scaling) ReturnValue = ScaledValue / Scaling If Err.Number <> 0 Then ' Decimal overflow. ' Round Value without conversion to Decimal.

If you're having a computer problem, ask on our forum for advice. Access Query Decimal Places Not Working It's quick & easy. To view links or images in signatures your post count must be 10 or greater. I'm technical referent but I lost the lead for technical decisions Do you want me?

Access Vba Round

Round(CCur(2.25), 1), Round(CCur(2.15), 1) -- Allen Browne - Microsoft MVP. Copyright © 2003-2016 TechOnTheNet.com. Ms Access Decimal Places But what I really get is 1.25 ! Access Int Function To round towards zero, use Fix() instead of Int(): Fix(100 * [MyField]) / 100 Rounding up To round upwards towards the next highest number, take advantage of the way Int()

You currently have 0 posts. his comment is here Jamie. -- Jamie Collins, Oct 5, 2007 #11 Advertisements Show Ignored Content Want to reply to this thread or ask your own question? FYI: I'm currently using this "Round" formula in a number of places in this database and I think it's worked previously, but now it doesn't Any help would be much appreciated!! Can the captain change players' positions without permission from a coach or manager? Access Decimal Places Not Working

Tip to Avoid Bankers Rounding: If you want to avoid bankers rounding, you can create your own custom function as follows: Public Function RoundIt(AValue As Double, DecimalPlaces As Integer) As Double The decimal places property of the field is 'Auto', but that should be irrelevant, shouldn't it? RoundIt = Round(AValue + AddThis, DecimalPlaces) End Function And then call the RoundIt function instead of using the Round function. this contact form You currently have 0 posts.

Why do Phineas and Ferb get 104 days of summer vacation? Access Ceiling Function Steve rsf View Public Profile Find More Posts by rsf

09-18-2009, 05:08 PM #2 jjturner Newly Registered User Join Date: Aug 2002 Location: Boston, MA current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list.

I was unaware of that weird behavior before, so now if I change the standard Round to something else, this may cause existing invoices to change :) Aug 24 '07 #5

However, I use this trick quite often, most frequently as a delayed Current event. for example, round(0.5) is 1.0 and round(-0.5) is -1.0). " However, for example, the number being rounded in my case is 404.685 rounded to 2 decimals. Therefore this expression rounds 2.1 up to 3. Access Vba Round Up Nearest Whole Number thanks, –Curtis Inderwiesche Oct 6 '08 at 4:56 add a comment| 12 Answers 12 active oldest votes up vote 25 down vote accepted Be careful, the VBA Round function uses Banker's

Those with Variant as return type will return Null for incomprehensible input A test module for test and validating is included as well. In case you're interested: We process billing for 50 temp staff across 5 different temp agencies and anytime someone goes into overtime ([Bill rate]*1.5) * [OT Hours] it runs the risk Your cache administrator is webmaster. navigate here I suppose that this caused by VBA math precision.

Join our community for more solutions or to ask questions. So, 0.125 rounds to 0.12 (2 is even), whereas 0.135 rounds to 0.14 (4 is even.) The core idea here is fairness: 1,2,3, and 4 get rounded down. 6,7,8, and 9 For example: Round(CCur(1.245) ,2) = 1.24 (as expected) Round(CDbl(1.245) ,2) = Round(1.245 ,2) = 1.25 ! Results 1 to 12 of 12 Thread: "Round" Function not rounding correctly!!

It treats all other decimals the same way. When data type is Currency or Decimal, Round works as it supposed to (Banker's round). more hot questions question feed about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Science TIA > > Jamie.

Posts: 53 Thanks: 0 Thanked 0 Times in 0 Posts Problem with Round Function Hello I have a problem with the round function, if a value = 1.2345 the round figure Any Ideas Regards DB #2 (permalink) May 17th, 2007, 11:49 AM allenm Friend of Wrox Points: 513, Level: 8 Activity: 0% Join Date: Feb 2007 Location: Davenport, IA, Hope it helps future poor saps like myself save an hour or two. Why doesn't it return 39.55?!

Reply With Quote 07-01-04,21:00 #6 Bullschmidt View Profile View Forum Posts Visit Homepage Guru Join Date Jun 2003 Location USA Posts 1,032 And thank you for all the kind words - I'll dig about some more and see if I can find out anything else... First Name Please enter a first name Last Name Please enter a last name Email We will never share this with anyone. After further investigation i found that the figures that were being supplied to me via excel had incorrect rounding figures as well.

I tried to implement the SymArith function from Microsoft in VBA for my rounding, but found that Fix has an error when you try to give it a number like 58.55; So I need a real rounding function in a VB6 app. The Currency data type in Access is fixed point: it always stores 4 decimal places. But what I really get is 1.25 !