Solved

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

Posted on 2013-06-07
4
247 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now