I have a list of serial numbers that I need listed in order but they aren't 
formatted the same, they start with 4 digit year and then item serial. Ok 
sounds easy but the serial numbers arent the same length, so serial #9 for 1950 
would be 19509 and serial #101 for 1950 would be 1950101. So if you sort by the 
serial and asc 1950101 would come before 19509 which it shouldnt but 
mathematically is correct. Having the client add 0's to serial numbers isnt an 
option, there aren't very many like 20 but I would like them to be in order, is 
there anything in sql that can do this? 

btw~ using mysql
the relevant sql

order by serial asc

this is what some of the current list looks like.
193932
19399
1948148
194874
194878
194886
1949157
1949160 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:293929
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to