Re: Sorting issue
| From: | David T-G | Date: | Fri, 08 Aug 2003 17:31:55 +0000 |
| Subject: | Re: Sorting issue | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-29772@lists.php.net to get a copy of this message | ||
Jeff --
..and then Jeff said...
%
% One last question.
%
% I changed all the DB values where numbers are used - (varchar - int)
Well, you should only change for those where the numbers are numbers...
%
% But for the well locations, there are dashes in them, I.E. 10-15-065-22
Exactly.
%
% With setting the field to int, it only displays the first part.
% 10-15-065-22 shows as 10
% There are also several other fields that use dashes.
Then those are an alphanumeric mixture and should be a varchar.
%
% If I set it back to varchar, will it sort it right because the numbers are
% separated by an alfa character, or will I have the same problem as before?
If the numbers are padded then it will sort right. That is, is the 065
holding three places with a zero? If it's always 2-2-3-2 digits then
sorting will be just fine (just like "00055" would have sorted as you
expected against "14000" in a varchar field).
HTH & HAND
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!