Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

rnd max scale/precision

Posted on 2011-03-03
2
Medium Priority
?
335 Views
Last Modified: 2012-08-14
http://office.microsoft.com/en-us/access-help/rnd-function-HA001228901.aspx
does not tell how much precision/scale is guaranteed on plain rnd

like could or would it be 0.12345678 or 0.1234567890 or 0.123456789012 etc

can this be controlled or set using a switch in access?

thanks
0
Comment
Question by:anushahanna
2 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 total points
ID: 35034483
rnd() returns a Single.

The defined range for single is
–3402823E38 to –1.401298E–45 or 1.401298E–45 to 3.402823E38
rnd() obviously doesn't use the whole range as it only returns a number between 0 and 1


I'm not sure wheteher this range definition means that there can never be more than 7 significant digits, but certainly I've never seen a result with more than 7.

However you also have to bear in mind that using rnd() you can get results like..
 5.623686E-02

If you were using rnd() to get unique IDs then this result is going to give you problems. ( I'm just linking this Q with others you have been posting lately).


0
 
LVL 6

Author Comment

by:anushahanna
ID: 35037467
hmm.. at least we tried..

thanks Peter.
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question