How to filter out the records with the latest date?
It worked I found 2 bugs:

Line 5:


  $wpdb->task_actions.datetime = $wpdb->mostrecent.datetime");
  Had to be: task_actions.created_taskaction instead of task_actions.datetime 


Also the $wpdb-&gt; sometimes doesn't work properly, so I changed all of them with wp_