PC Review


Reply
 
 
Steve
Guest
Posts: n/a
 
      16th Dec 2009
Greetings:

I have numeric data with which I do not need to perform calculations nor do
I need to sort it. Is it better to store this type of data as a number or
text in terms of the efficiency of the database? Thanks for any thoughts on
this.
--
Steve
 
Reply With Quote
 
 
 
 
Ken Snell
Guest
Posts: n/a
 
      16th Dec 2009
Number datatype usually occupies less memory space than text, depending on
the number of digits in the number (as the number of digits increases, text
uses more memory while number uses same amount regardless of digit count).
So go with number.

--

Ken Snell
http://www.accessmvp.com/KDSnell/


"Steve" <(E-Mail Removed)> wrote in message
news:18C8F658-8083-4A6C-8868-(E-Mail Removed)...
> Greetings:
>
> I have numeric data with which I do not need to perform calculations nor
> do
> I need to sort it. Is it better to store this type of data as a number or
> text in terms of the efficiency of the database? Thanks for any thoughts
> on
> this.
> --
> Steve



 
Reply With Quote
 
Jerry Whittle
Guest
Posts: n/a
 
      16th Dec 2009
I disagree with Ken. Some 'numbers', such as Social Security Numbers,
Zipcodes, and even some phone numbers, can start with zeros. If you store
these in a number field, the leading zeros are removed. Then you need to use
code or fancy formatting to reinsert the zeros before use in something like a
mail merge. There goes any efficiency of storing it as a number.

I say that if your aren't doing math on it, it isn't a number.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Steve" wrote:

> Greetings:
>
> I have numeric data with which I do not need to perform calculations nor do
> I need to sort it. Is it better to store this type of data as a number or
> text in terms of the efficiency of the database? Thanks for any thoughts on
> this.
> --
> Steve

 
Reply With Quote
 
Keith Wilby
Guest
Posts: n/a
 
      16th Dec 2009
"Jerry Whittle" <(E-Mail Removed)> wrote in message
news:F10879D8-01B9-4639-84AD-(E-Mail Removed)...
>
> I say that if your aren't doing math on it, it isn't a number.
>


FWIW I agree and I must say that I thought it was "best practice" too.

Keith.
www.keithwilby.co.uk

 
Reply With Quote
 
Jeff Boyce
Guest
Posts: n/a
 
      16th Dec 2009
Steve

Just because you call it a "number" doesn't make it a true number. As
others have pointed out, if you don't need to "do math" on it, it isn't
really a number.

If it isn't really a number, don't 'type' it as a numeric data type. Access
expects different things when using numbers, and handles numbers differently
(see comment in-thread about leading zeros...).

And if you are concerned about "the efficiency" of the database, I don't
believe you'd notice the difference in either performance or storage, using
Text vs. Numeric data types ... unless your database had millions of rows!

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Steve" <(E-Mail Removed)> wrote in message
news:18C8F658-8083-4A6C-8868-(E-Mail Removed)...
> Greetings:
>
> I have numeric data with which I do not need to perform calculations nor
> do
> I need to sort it. Is it better to store this type of data as a number or
> text in terms of the efficiency of the database? Thanks for any thoughts
> on
> this.
> --
> Steve



 
Reply With Quote
 
Clifford Bass
Guest
Posts: n/a
 
      16th Dec 2009
Hi Steve,

Here is my take: If it is a number, as in a real number and not
something called a number that may not be a number, then store it as a number
because that will ensure that the data is always numeric. Just because you
are not doing calculations, does not mean that it is not a number. If there
is one thing I hate, it is getting data from sources in Access tables where
they store the numbers in text fields. That makes me check all those values
to make sure they really are numbers.

Explanation on "something called a number that may not be a number":
Telephone "numbers" as they often have extra characters--think especially
international numbers that do not follow your country's format;
company-internal numbers such as 2-3456; and cell-phone shortcuts such as
*123. I like to provide free-form text columns/boxes for those so the user
can enter whatever is necessary. National ID numbers which may use varying
formats and even letters.

If you set up for text columns for true numbers, it makes for a lot
more work to ensure that you only have true numbers in those columns. And
you have to enforce that everywhere that the data may come into your table.
In my opinion this issue far outweighs any minor performance hit in
formatting numbers to include leading zeroes or other types of formats.
Formatting of numbers is a well developed process that I am sure is designed
to be highly efficient. Reading data from disk and over the network is
likely to be slow in comparison to the execution of the formatting code. An
integer is two bytes. To store that same number as a text column you need up
to six bytes (one for the sign and five for the digits). For a long you need
four bytes as a number. To store that in text you need up to eleven bytes.
So storing those as text to can triple the amount of data you have to store,
send and retrieve. In a small database this will not be noticable. In a
large one it will.

Again, my take,

Clifford Bass

"Steve" wrote:

> Greetings:
>
> I have numeric data with which I do not need to perform calculations nor do
> I need to sort it. Is it better to store this type of data as a number or
> text in terms of the efficiency of the database? Thanks for any thoughts on
> this.
> --
> Steve

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert a Number data type to a Text data type TKM Microsoft Access Queries 9 6th Nov 2008 09:59 PM
Data Type Mismatch in Expression - can I force a query to read as a diferent data type? S Davis Microsoft Access Queries 1 7th Jun 2007 11:33 PM
Append Data Type Text Y/N to Data Type Y/N in Query HELP! =?Utf-8?B?dHJveQ==?= Microsoft Access Queries 1 25th Apr 2006 01:11 AM
Change Memo data type to Text data type DS Microsoft Access Getting Started 1 26th Jan 2005 04:56 PM
Convert String Data Type to UniqueIdentifier data type =?Utf-8?B?YW5n?= Microsoft ADO .NET 4 26th Jan 2004 10:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:30 AM.