Title: [Plugin: WordPress Form Manager] Summary Display Order
Last modified: August 20, 2016

---

# [Plugin: WordPress Form Manager] Summary Display Order

 *  [aljrit](https://wordpress.org/support/users/aljrit/)
 * (@aljrit)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-summary-display-order/)
 * Hi
 * Firstly, a great form manager. Only came across it recently but have used on 
   a couple of sites and will certainly use again.
 * I have scanned through all the posts and cannot see this raised before – apologies
   if I missed it…
 * I need to display the data in the order of one of the fields. Have given this
   field a nickname of ‘date’. The field’s format is dd-MON-yy.
 * On the page displaying the data I have [formdata courses-1 orderby=”date”]. Only
   problem is that the order displayed is not correct, it sort of follows the field‘
   date’ but not entirely. I assume I am missing a trick here, any and all help 
   really appreciated.
 * URL is [http://www.trager.co.uk/training-courses/course-details](http://www.trager.co.uk/training-courses/course-details)
   and the field’s label is ‘Start date (DD-Mon-YY)’
 * [http://wordpress.org/extend/plugins/wordpress-form-manager/](http://wordpress.org/extend/plugins/wordpress-form-manager/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [aljrit](https://wordpress.org/support/users/aljrit/)
 * (@aljrit)
 * [14 years ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-summary-display-order/#post-2707254)
 * Think I may have found the problem. The data is displayed in order of day of 
   the month (the first 2 digits of the field). I guess what is needed is a strtotime
   to get the numerical value of the date and then order by that.
 * Only problem is I have little PHP experience and no knowledge of MySQL. So I 
   have no idea how to implement. Do I modify api.php – and if so, then how?
 * Any ideas or help would be great.
 * Thanks
 *  Plugin Author [hoffcamp](https://wordpress.org/support/users/hoffcamp/)
 * (@hoffcamp)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-summary-display-order/#post-2707290)
 * This is a bug. The ‘date’ field is really just a text field, so as far as the
   code is concerned, its the same as any other. The validation information isn’t
   really accessible to the query function, since its just a script that runs on
   the user side.
 * The relevant code starts at line 1082 of db.php. You can see there is a hack 
   already for numerical versus text sorting (ASC_N and DESC_N do numerical sort,
   ASC and DESC do alphabetical). The $orderBy variable stores the MySQL ‘ORDERBY’
   clause.
 * You can insert the following to get special ‘ASC_D’ and ‘DESC_D’ date sorters
   for the format you mentioned (dd-MON-yy), after the ‘if’ and before the ‘else’:
 *     ```
       elseif ($ord == 'ASC_D' || $ord == 'DESC_D'){
       		$ord = substr($ord,0,strlen($ord)-2);
       		$orderBy = 'STR_TO_DATE(<code>'.$orderBy.'</code>, \'%d-%b-%y\')';
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: WordPress Form Manager] Summary Display Order’ is closed to 
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wordpress-form-manager.svg)
 * [Form Manager](https://wordpress.org/plugins/wordpress-form-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-form-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-form-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-form-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-form-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-form-manager/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [hoffcamp](https://wordpress.org/support/users/hoffcamp/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-wordpress-form-manager-summary-display-order/#post-2707290)
 * Status: not resolved