Solved

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

Posted on 2013-01-24
4
316 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

816 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now