Solved

Access 2010 - Creating fields in a table - help with field types

Posted on 2013-06-07
4
286 Views
Last Modified: 2013-07-06
As options.
I'm not understanding the specific date types here:
what does the word "single" refer to?  I know it's not single integer.
Please fill in the blank, or supply me with an official MS link that describes these data types.
Single _________
Double _______
Decimal _________
How do I decide which one to use?  
Or should I just use "double" for everything?
0
Comment
Question by:brothertruffle880
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 250 total points
ID: 39228439
This is not an "official MS Link", but Allen Browne is a very well-respected Microsoft MVP who has done a terrific job of spelling out the different datatypes here:

http://allenbrowne.com/xbase-05.html
0
 
LVL 61

Assisted Solution

by:mbizup
mbizup earned 250 total points
ID: 39228471
Regarding when you would use one data type over the other... it depends on the values and precision of the numbers you want to store.  As a test, you can add code like the following to a VBA module:

Sub test1()
    Dim I as integer
    Dim x As Single
    Dim y As Double
End Sub

Open in new window


Placing the cursor over the integer, single or double and hitting F1 will give you a quick description of the datatypes -- including allowable ranges.

Singles, for many purposes are arguably better than doubles since they take up less space (and have a range that works for many uses).
0
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 125 total points
ID: 39228521
You also need to consider the Currency datatype if you have decimal numbers which require absolute accuracy.

Both Single and double are precise but not accurate - just do 1.7-1.6 in the immediate window to see.
This inaccuracy is due to the inability of binary numbers to represent the fractional part of most decimal numbers.

Currency datatype (which is a special case of the decimal datatype) stores numbers as integers and does run-time conversion to their decimal representation and are accurate to 4 d.p. (do not confuse Currency datatype with Currency Format).
0
 
LVL 20

Assisted Solution

by:clarkscott
clarkscott earned 125 total points
ID: 39237732
Dont' use Decimal for numeric values.  It will display large numbers... but you can't do anything with the values unless you're satisified with scientific notation.  The decimal save data as strings and is used primarily for downloading/importing data from DB or other large databases (mainframes).

Scott C
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

751 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