Re: FN-FORUM: Storing the leading 0 of product codes in MySQL
date posted 11th October 2006 11:19
Dave Cross wrote:
> Quoting D D Glendinning [EMAIL REMOVED]
>
>> Morning all again,
>>
>> Right, I am storing products codes, split into two fields, one for
>> characters, and one for digits.. The problem is that I need 01 stored
>> as 01 and not as 1, and sadly I can't store it in the characters
>> field... so is there a field type that preservers the 0?
>
> Er... yes - text :)
>
> If the leading zero is significant, then what you have is a string of
> digits. It isn't a number. It should therefore be stored in a text
> field.
I'm puzzled as to why you're splitting the product code! What possible
reason could you have for storing a product code in two pieces?
sometimes this list baffles and bemuses me to the point of exasperation.