[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 325
  • Last Modified:

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

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
allenkent
Asked:
allenkent
  • 3
1 Solution
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
The backslash \ character does integer math, where 7 \ 4 = 1, and not 1.75.
Perhaps you meant to do / ?
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
<in my Immediate window>

? 3341.36 \ (30 * 11)
 10

? 3341.36 / (30 * 11)
 10.1253333333333
0
 
allenkentAuthor Commented:
LOL - I didnt get enough sleep last night!
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now