Jump to content

This topic is 8066 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

This seems like a dumb question, but I thought I'd ask just in case there are some smart answers! smile.gif

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?

Posted

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

Posted

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.

Posted

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.)

Posted

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.

This topic is 8066 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.