Sorting date fields

Talk about Sorting & Paging problems, issues etc.

Moderator: alexandrleonenko

bgsherm
Newbie
Newbie
Posts: 5
Joined: Apr 28th, '09, 20:48

Sorting date fields

Postby bgsherm » Aug 12th, '09, 17:58

I am trying to find a way to sort date fields. Currently, I can only do a text sort.
This means that 8/1/2002 is sorted after 1/1/2009.
I do not see a field type of date or datetime in the list of types for the display options.

Please let me know what I can do.

thanks.

bgsherm
Newbie
Newbie
Posts: 5
Joined: Apr 28th, '09, 20:48

Re: Sorting date fields

Postby bgsherm » Aug 12th, '09, 19:13

Found the solution

1) create sql field
DATE_FORMAT(DateOpen,'%Y%m%d') as DateOpenSort
2) Add sort_by option in the display parms
header=>'Date Opened',type=>'Label',sort_by=>'DateOpenSort'

Works like a champ


Return to “Settings: Sorting & Paging”