Solved

Access 2003 query, round down to nearest 5 cents

Posted on 2016-10-11
3
22 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
3 Comments
 
LVL 24

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 49

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

747 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