Problem with Numeric Sort?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
dougwong55
Posts: 13
Joined: Tue Feb 15, 2005 1:00 am

Problem with Numeric Sort?

Post by dougwong55 »

I have a number of dates, 1 per line, in descending order. I would like to sort them in ascending order. When I select the seemingly logical "numeric" sorting things come out funny, but when I select "case sensitive" or "case insensitive" everything is fine. There are only about 145 dates so far, so I'm not exceeding any limit and the dates are all in 2008, so there is no year wrap. This has bitten me more than once. I can remember the workaround better if I understand what's going on. Does anyone know what is the matter? Thanks in advance.

Sort Options:
Key 1: column 1, length 10
Ascending checked.
In character code order checked.

portion of original data. dates in U.S. date format: month/day/year
...
07/21/2008
07/21/2008
07/20/2008
07/20/2008
07/20/2008
07/20/2008
07/20/2008
07/20/2008
07/20/2008
07/19/2008
07/19/2008
07/19/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/17/2008
07/17/2008
...

sorted in numeric order
...
07/17/2008
07/17/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/31/2008
07/31/2008
07/31/2008
07/31/2008
07/31/2008
07/31/2008
07/31/2008
07/31/2008
07/30/2008
07/30/2008
07/30/2008
07/29/2008
07/29/2008
07/29/2008
07/29/2008
07/29/2008
07/29/2008
...

sorted in case sensitive
...
07/17/2008
07/17/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/18/2008
07/19/2008
07/19/2008
07/19/2008
07/20/2008
07/20/2008
07/20/2008
07/20/2008
07/20/2008
07/20/2008
07/20/2008
07/21/2008
07/21/2008
...
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Treat them as text strings, not as numbers. Numbers do not have "/" in them, that is a "division" symbol.

Sorting as text, case sensitive/insensitive both do a perfect sort.
Hope this was helpful.............good luck,
Bob
bveldkamp

Post by bveldkamp »

Obviously it won't work if the dates span multiple years
Post Reply