Solved

Access 2003 query, round down to nearest 5 cents

Posted on 2016-10-11
3
41 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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.

749 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