Wednesday, April 13, 2011

Integer vs. string

I think, but I may be wrong, that when you set up your database and define the datatypes that it's best to choose string (varchar) instead of integer unless the value truly needs to be treated as an integer. I'm just guessing though. My reason for this thought is that I set one of my fields as an integer because a user would enter numbers into it. But in reality the numbers were just a label and I probably should have made that field a varchar. I say this because those values are used as the choices for a combobox and I can't include a blank value with the number...because blank is not an integer. I've added "zero" to the list but I don't like it. I want blank, so I'll have to figure something else out.

No comments:

Post a Comment