Solved

Access 2003 query, round down to nearest 5 cents

Posted on 2016-10-11
3
54 Views
Last Modified: 2016-10-12
How do I get prices to round down to nearest nickle without using code? Id like to do it from with the query. Here's what Ive tried but it throws the price totally out of whack:

Round(20*products.price+inventoryprofile.estshipcost,0)/20

Thanks.
0
Comment
Question by:QMBB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 25

Accepted Solution

by:
chaau earned 500 total points
ID: 41839307
You need to use brackets ( ) to make sure that the multiplication applies to the whole expression, not just the products.price:
Round(20*(products.price+inventoryprofile.estshipcost),0)/20

Open in new window

0
 

Author Closing Comment

by:QMBB
ID: 41839316
Woo hoo! Thanks.
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 41839631
No Woo Hoo, as this code doesn't round down but rounds to the nearest even.
Further, Round is buggy.

To round down, you need this:

    ListPrice: Int(20*(products.price+inventoryprofile.estshipcost))/20

If you have a serious need for rounding, study the options here:

Rounding values up, down, by 4/5, or to significant figures

/gustav
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

717 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