473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Multiplying in Access

I am trying to multiply 2 fields in Access
Field1 has a value of 70.1
Field2 has a value of 2.05

Formula is
[Field1] * [Field2]

Result is 143.704996657372

Help!! I really need it to give me the correct result of 143.705
I don't have a clue why access is not multiplying this correctly.

Just in case this makes a difference:
Field1 is defined on the table as Currency-Currency-Auto (decimal places)
Field2 is defined on the table as Number-Single-Fixed (6 decimal places)
Mar 8 '10 #1

✓ answered by ADezii

Try:
Expand|Select|Wrap|Line Numbers
  1. =FormatNumber([Field1] * [Field2],3)

4 11016
ADezii
8,834 Expert 8TB
Try:
Expand|Select|Wrap|Line Numbers
  1. =FormatNumber([Field1] * [Field2],3)
Mar 8 '10 #2
Stewart Ross
2,545 Expert Mod 2GB
All floating-point calculations are subject to rounding errors. Your second field is defined as of type single-precision - the lowest-accuracy form of floating-point storage used in VBA. Even if you used double-precision floating point values - which I would use as a matter of routine and not use the Single type at all - you will still face rounding errors in calculations.

ADezii's suggestion of using formatting to round the number is a good one.

I would use a double-precision field and simply round it for display purposes, using either formatting to three decimal places as ADezii suggests or explicit rounding (assuming that no further calculations are necessary):

=Round([Field1]*[Field2), 3)

By the way, using names such as Field1 and Field2 is a waste of a field name. Give your fields meaningful names that tell the reader what your field is storing.

-Stewart
Mar 8 '10 #3
TheSmileyCoder
2,322 Expert Mod 2GB
Thats Access 2007 for you. Makes it way to easy to create tables with meaningless field names. :)
Mar 8 '10 #4
Actually I do have better field names but for the purpose of posting the question I tried to simplify. The answer given by ADezii seems to have fixed by problem. Thank you everyone for your help.
Mar 9 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

63
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy...
13
by: bill | last post by:
I am trying to convince a client that dotNet is preferable to an Access project (ADP/ADE). This client currently has a large, pure Access MDB solution with 30+ users, which needs to be upgraded....
2
by: cplusplus | last post by:
Hello, I have newbie question. I'm stuck on this current assignment. Write a program that prompts the user for two integer values, passes the values to a function where they are multiplied...
1
by: Dave | last post by:
Hello NG, Regarding access-declarations and member using-declarations as used to change the access level of an inherited base member... Two things need to be considered when determining an...
2
by: Targa | last post by:
<input NAME="TAXRATE" onBlur="this.form.TAX.value = (this.form.TAXRATE.value - 0) * (this.form.ITEM1TOTAL.value - 0) + (this.form.ITEM2TOTAL.value - 0) " Size="4"> In my TAX field I get...
1
by: Matthew Kramer | last post by:
How could I create a query which multiples all the values in one field of a table by 1000? Would it be done the same way to do the same thing on a query from a query of table? Thanks. Mat ...
2
by: k | last post by:
I have aproblem when multiplying 2 float 638.9 * 382.8 should = 244570.92 results giving 244570.922 both numbers are float variables , tried using double to...
3
by: Dave | last post by:
Hello I've created a student database for our program that I also need to get statistics from. It's in Access 2003. The statistics would be things like Male-Female percentage, percentage of...
2
by: jho | last post by:
hello, I have a pricing sheet form and have the following fields in one row: SKU DESC UNIT PRICE QTY PRICE I want to select the sku in the form and have the corresponding desc and unit...
3
by: damhotpepper | last post by:
How do I total 2 columns by multiplying their values together. Table Products, UnitQty x Unit Price ? Any help would be great.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.