p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access VBA (http://p2p.wrox.com/forumdisplay.php?f=80)
-   -   text vs integer (http://p2p.wrox.com/showthread.php?t=53638)

paul20091968 February 5th, 2007 10:16 AM

text vs integer
Hi everyone,

I have a question is it true that working with numerical fields is quicker than text fields.
for example we have a connote with number 12345689 my colleagues converts this into text but I use number what is correct and is there doucmentation explaining why text or numbers is faster

mmcdonal February 5th, 2007 01:05 PM

What do you mean when you say "working with numerical fields is quicker than text fields"?

What are you trying to do? Generally you use number data types only when doing calculations. If you are storing a number that will not be used in calculations, such as phone numbers and zip codes, you use text. If you are doing any calculations, except for currency, you use number, and currency for cash.

If you use a number field where you want a text field, then you can end up with formatting issues and erroneous equations when doing queries.

I don't ever recall seeing that numbers work faster than text, except perhaps in this case where your colleagues are converting the data (presumably in code [re-typing a variable]) and that will always add time to a function or subroutine - but not much usually, unless it is a big batch job. I think otherwise the only thing that would determine the speed of the operation is the AMOUNT of data stored in the field, and not necessarily the data type. If you are using 9 character values in your text field, set the field size to 9, and this will speed up the operations in the aggregate.

Did that help any?


vbark February 13th, 2007 10:50 PM

In Access a Long Integer field can store figures up to 2,147,483,647
If there is no formatting issue such as connote's begining with a letter or preceded by a zero then a number field in a database will be smaller to store, take up less space to index, be faster to search and faster when joining by that field in a query.

All times are GMT -4. The time now is 02:25 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.