Solved

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

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

708 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

19 Experts available now in Live!

Get 1:1 Help Now