Re: FN-FORUM: Storing the leading 0 of product codes in MySQL
date posted 11th October 2006 12:09
Quoting D D Glendinning [EMAIL REMOVED]
>
> Paul.
>
> Thanks for your thoughts... It is being stored as two fields because I
> need to be able to order by the number when the products are listed..
> Thats also the reson why I can't store the number as text, or else it
> won't oder numerically.
Are you contradicting yourself there? If you have numbers (e.g. 1, 2,
100) then a text-based sort will sort them incorrectly (1, 100, 2).
But if you have zero padded numbers stored as text (001, 002, 100) a
text-based sort will sort them correctly.
Or am I missing something?
Dave...
--
Magnum Solutions Ltd
Open Source Consultancy, Development and Training
http://mag-sol.com/