Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-06-07
4
Medium Priority
?
302 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 1000 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 1000 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 500 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 500 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

718 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