By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,347 Members | 2,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,347 IT Pros & Developers. It's quick & easy.

Number precision

P: 32
Hi,

I have a make-table query with one attribute that is derrived from multiplying a number against currency value.

For example:

Hours Worked * Rate = Expense

95.516 * $55.54 = 5305.0446044

How can I control the decimal places so that I end up with this?

95.516 * $55.54 = $5305.04

I've tried editing the field properties in the query design window to change the result to currency but that didn't work. Should I have an input mask?

Thanks,
Jason
Mar 10 '08 #1
Share this Question
Share on Google+
2 Replies


Zwoker
P: 66
Hi,

I have a make-table query with one attribute that is derrived from multiplying a number against currency value.

For example:

Hours Worked * Rate = Expense

95.516 * $55.54 = 5305.0446044

How can I control the decimal places so that I end up with this?

95.516 * $55.54 = $5305.04

I've tried editing the field properties in the query design window to change the result to currency but that didn't work. Should I have an input mask?

Thanks,
Jason
I see two obvious possibilities - Someone who knows more than me can probably suggest more (or better ones) *grin*:

1) Control the result at calculation time with a round statement. E.g. Expense = Round(Hours Worked * Rate, 2). This would store the result with 2 decimals.

2) Keep the data stored with more precision, but display the result formatted. E.g. <Output> = Format(Expenses, "0.00")

Both examples above are more pseudo-code than real VBA - You should check the help in your version of MS Access to see the options and true syntax.
Mar 10 '08 #2

P: 32
These both sound like good solutions, I'll give them a try. Thanks!
Mar 11 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.