compare data from two fields and return new result in report

Eyor

Registered User.
Local time
Today, 11:23
Joined
Jul 13, 2006
Messages
26
I am creating a report which will return numeric results for materials analyzed. The problem is that significant figures need to be preserved so, each result has a separate entry for the number of significant figures since access chops off trailing zeros in numeric fields (as far as I know). This is fine for storing data but, makes for a very messy report.

Can I run some sort of function in the report which will compare the result with the number of significant figures and then add a decimal zero if there is a difference?

The logic could be something like this:

If number of characters in result < value of significant figure
then add a decimal zero to result
else return result

Unfortunately, I am new to Access and not sure if this can be done, thanks very much for any help. Even knowing if this is possible and how best to approach it would be a great help.
 
The hardest part here is getting the decimals correct. Only way I can think of doing this is by converting to scientific notation like so

9.7 = 9 X 10(0) + 7 X 10(-1)

Is there a function which will convert to scientific notation?

Also, how do I count the number of characters in the result?

Here's a full breakdown of what is needed, if anyone knows how to do any of these steps please help

1. count number of characters in result
2. If number of characters < value of significant figures
Then
3. convert result to scientific notation like so
9.7 = 9 X 10(0) + 7 X 10-1
4. take value of last exponent and subtract 1
5. add 0 X 10 (value of last exponent – 1) to result
6. convert result to standard notation and print
Else
7. return result

Thank You!
 
Last edited:

Users who are viewing this thread

Back
Top Bottom