Solved

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

Posted on 2013-06-07
4
269 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
  • 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

777 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