Hi all. I recently had to create an online survey for one of our Vice Presidents, and one of the required fields is an alumni id. This is generally a nine digit number, but for older ids it can vary from 4-6 digits.
I need to be able to store older ids with leading zeros, but when I submit an older id, for example 000012345, what will be entered in the db is 12345.
This makes perfect sense, but in this case I actually need the leading zeros.
I don't really need to make changes until after the data has been collected, as I'm using PHP to output the database straight to an Excel spreadsheet, so I'll just pad the necessary ids at that point, but for future reference, how can I set it up such that integer fields can store the leading zeros?
Actually, I just found a bit of info in the docs that indicates that to do this I must actually use a character field to store the id, then convert to an integer if ever needed.
Is this the only way to accomplish this task?
Thanks much in advance,
Pablo
I need to be able to store older ids with leading zeros, but when I submit an older id, for example 000012345, what will be entered in the db is 12345.
This makes perfect sense, but in this case I actually need the leading zeros.
I don't really need to make changes until after the data has been collected, as I'm using PHP to output the database straight to an Excel spreadsheet, so I'll just pad the necessary ids at that point, but for future reference, how can I set it up such that integer fields can store the leading zeros?
Actually, I just found a bit of info in the docs that indicates that to do this I must actually use a character field to store the id, then convert to an integer if ever needed.
Is this the only way to accomplish this task?
Thanks much in advance,
Pablo