Solved

Access 2003 - dividing number is not giving correct value (rounding why?)

Posted on 2013-01-24
4
317 Views
Last Modified: 2013-01-24
I have a simple query and I am mulitplying the LOT_SIZE*LOT_QUANTITY / LOT_PRICE so I can get a per unit cost.

Here is what I have tried:  
SAMPLE DATA:   30 size    with   11 quantity   with cost of $3341.36    (answer should be $10.13)

I am using:

Unit_Cost: [LOT_COST]\([LOT_SIZE]*[LOT_QUANTITY])
- I keep getting answer of 10. The system is rounding for me and I dont want it to.
0
Comment
Question by:allenkent
  • 3
4 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 305 total points
ID: 38815565
The backslash \ character does integer math, where 7 \ 4 = 1, and not 1.75.
Perhaps you meant to do / ?
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 38815575
<in my Immediate window>

? 3341.36 \ (30 * 11)
 10

? 3341.36 / (30 * 11)
 10.1253333333333
0
 

Author Closing Comment

by:allenkent
ID: 38815581
LOL - I didnt get enough sleep last night!
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 38815605
You were just testing us to see if we were awake, we know..

Thanks for the grade.  Good luck with your project.  -Jim
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question