Fraction number in Access

  • Thread starter KimTong via AccessMonster.com
  • Start date
K

KimTong via AccessMonster.com

Is anybody can tell me, if MS Access can accept fraction number like Excel?.
I had a project before, the user had to enter with fraction number. I still
can't figure it out untul now.

KF
 
J

Jeff Boyce

That depends... do you want Access to merely "accept" a string of
characters, or will you be wanting to "do math" on the value that string of
characters represents?

If the latter, one way to do this would be to build a function that takes a
"text" input (e.g., "1/5") and converts it to a decimal equivalent. Access
can "do math" on the decimal equivalent.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
K

KimTong via AccessMonster.com

I don't mind wheter Access accept in Text or Number, as long as Acces can do
calculation. So when the user enter the price, that price should be in
fraction. Then Access has to convert it in decimal or whatever, so we can
calculate that field when we need it.

Thanks for your help.

KF
 
K

KimTong via AccessMonster.com

How to convert from "1/5" to 0.20 (in decimal)?
THanks...

KF

Jeff said:
That depends... do you want Access to merely "accept" a string of
characters, or will you be wanting to "do math" on the value that string of
characters represents?

If the latter, one way to do this would be to build a function that takes a
"text" input (e.g., "1/5") and converts it to a decimal equivalent. Access
can "do math" on the decimal equivalent.

Regards

Jeff Boyce
Microsoft Office/Access MVP
Is anybody can tell me, if MS Access can accept fraction number like
Excel?.
[quoted text clipped - 3 lines]
 
J

Jeff Boyce

Take a look at the Eval() function. I believe you can use
Eval("1/5") to get 0.2

You could do that calculation in a form, allowing the user to enter "1/5" in
an unbound textbox, then doing the math to get 0.2 and storing that via a
bound textbox (it could even be hidden).

Regards

Jeff Boyce
Microsoft Office/Access MVP

KimTong via AccessMonster.com said:
How to convert from "1/5" to 0.20 (in decimal)?
THanks...

KF

Jeff said:
That depends... do you want Access to merely "accept" a string of
characters, or will you be wanting to "do math" on the value that string
of
characters represents?

If the latter, one way to do this would be to build a function that takes
a
"text" input (e.g., "1/5") and converts it to a decimal equivalent.
Access
can "do math" on the decimal equivalent.

Regards

Jeff Boyce
Microsoft Office/Access MVP
Is anybody can tell me, if MS Access can accept fraction number like
Excel?.
[quoted text clipped - 3 lines]
 

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