This topic is locked

Sort By Month

12/13/2005 7:18:32 PM
PHPRunner General questions
L
little44236 author

I need to let people search for data by month and let them sort by month. I can do a field that has months in it but it sorts alphabetically. Best solution would be to allow proper sort by month.
As a solution I put in the last day of each month in a date field and told them to search for that. Sorting is now fine but the field is formated in 2004-01-01 which is not a shown format so the search field has to be typed in a different format than shown.
Bob Small
BTW: When is the PHPRunner update coming out? Great program, can't wait for the next version.

Sergey Kornilov admin 12/14/2005

Hi,
you can add a numeric field to your table to hold months numbers.

Then create a new table and fill it with month names and numbers:

id name

1 January

2 Feb...
And use this table as a lookup for month field in main table.

When you'll perform a sort on this field rows will be sorted in months order.
We plan to issue the next PHPRunner version in December 2005 or in the first half of January 2006.