Rounding to the Left of the Decimal

A

Amy E. Baggott

We have an incentive program that gives exhibitors a 30% discount on services
up to a maximum discount amount that is determined by their booth size. We
want to send a letter to them showing each of them what their maximum
discount is and how much they would have to spend to get it. On more than a
few records, the "must spend" amount trails off into odd cents. I have a
hunch my boss is going to want me to round it to the nearest $100. Does the
Round function round to the nearest 100 or would I have to construct some
sort of expression to do it the long way?
 
J

Jerry Whittle

In a query, something like below will work with the proper field name.

RoundedDiscount: CLng([TheField]/100) * 100
 
M

MGFoster

Amy said:
We have an incentive program that gives exhibitors a 30% discount on services
up to a maximum discount amount that is determined by their booth size. We
want to send a letter to them showing each of them what their maximum
discount is and how much they would have to spend to get it. On more than a
few records, the "must spend" amount trails off into odd cents. I have a
hunch my boss is going to want me to round it to the nearest $100. Does the
Round function round to the nearest 100 or would I have to construct some
sort of expression to do it the long way?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sometimes the Format() function can be used to round numbers. You must
remember that the function returns a string value, so you'll have to
convert that string to a number if you want to use it in further
calculations.

Format(235.56, "#") -> "236"
CInt(Format(235.56, "#")) -> 236

Format(235.567 "#.##") -> "235.57"
CDbl(Format(235.567, "#.##") -> 235.57

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBScghgoechKqOuFEgEQKqXQCgrmY5MHmbH0AAOff3B0Btu4ScizgAnjOG
HRG9SUij9SfqAjmL63x2REhK
=XO/R
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top