January 1, 200323 yr This seems like a dumb question, but I thought I'd ask just in case there are some smart answers! If you're not going to be performing any mathematical computations on a field, but you expect it only to contain numbers (eg: Invoice Number)... are there any advantages to using a number or text field?
January 1, 200323 yr If you wanted to sort invoices by Invoice Number and a text field was used, the sort wouldn't be in numerical order. Also, number formatting would not be available. -bd
January 2, 200323 yr Yep, use a Number if you want number formatting, number sorting, or to more easily use the field as a Number in number calcualations. The disadvantage is that a Number as a calculation is IEEE floating point... so precision may be lost if you need to hold numbers with lots of digits. And as a result you can get some weirdnesses of what's displayed vs. what is really in the field. If you are using the number as a key or ID field, I recommend using Text with storage type ASCII.
January 2, 200323 yr Author If you are using the number as a key or ID field, I recommend using Text with storage type ASCII. Yep, in particular I was thinking about record serial numbers (like invoice numbers, product numbers, etc.)
January 2, 200323 yr I try to use numbers as a last resort. I find that text fields are much better for invoices, product numbers etc because you can easily deal with and invoice or part number like AB0025-0347, which would give a number field convulsions, and which (hopefully) provides a bit more information to a user than a straight number. Adding leading zeros to the components of your "number" will get around sorting problems.
Create an account or sign in to comment