This topic is locked

sorting by date

9/16/2005 1:16:36 PM
PHPRunner General questions
scuba author

I receive incorrct results when sorting by date - list appears like this:
2005-9-9

2005-9-8

2005-9-7

2005-9-13

2005-9-6

2005-9-5

2005-9-11

...
it doesn't matter wether I use the column-name to sort or use the "order by" fuction for this column set on ASC or DESC - the results stays incorrect. What can I do, this is a critical function I urgently need.
thanks

Sergey Kornilov admin 9/19/2005

Hi,
the dates are sorted as text values in your example.

You should change database field type from VARCHAR to DATE to get the proper sorting order.

scuba author 9/19/2005

well, I guess that was a stupid question <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=6009&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

Thanks anyway!