isolate the cents value in a currency amount

S

Sharon

How do you isolate the cent amount in a field. For
example, we want to pick up the .01 or 40 in the following
figures: We tried rtrim, however, it picked up the
decimal point on the figure with .40.

12254.01 or 12255.40
 
L

Larry

-----Original Message-----
How do you isolate the cent amount in a field. For
example, we want to pick up the .01 or 40 in the following
figures: We tried rtrim, however, it picked up the
decimal point on the figure with .40.

12254.01 or 12255.40
.
12254.01-int(12254.01)
 
V

Van T. Dinh

A number of different ways:

(100*YourField) Mod 100

or

CInt((YourField - Int(YourField)) * 100)

You can treat the currency as Text and then get the last 2 characters using:

Right(Format([YourField], "0.00"), 2)

but I think the using mathematical cals is the more correct way to do this.
 
L

Loretta Jean

I like Van's first idea. If you want to convert it back
to decimals you could add * .01 on the end. Format it as
a 2 decimal number and you'll have what you're looking for.

((100*[centisolation]) Mod 100)*0.01
 

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