For anyone having problems with this contribution not functioning on newer mySQL servers (the date search not finding results even when it should do), it is very simple to resolve.
The query does not need to be altered much, you only need to add a blank space into the code and it functions.
The answer has been partly fixed earlier in this thread: but the earlier solution altered the SQL query, where it did not need altering.
The problem seems to be that the date format set for the <date to> field was incorrectly structured, which seemed to work in mysql 3.x but not in mysql 4.x
After some testing of the query itself, if you make the following change to catalog/admin/batch_print.php on line 79:
$orders_query = tep_db_query("select o.orders_id,h.comments,MIN(h.date_added) from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS_HISTORY . " h where o.date_purchased between '" . tep_db_input($startdate) . "' and '" . tep_db_input($enddate) . "23:59:59' and h.orders_id = o.orders_id" . $pull_w_status . $get_customer_comments . ' group by o.orders_id');
to this:
$orders_query = tep_db_query("select o.orders_id,h.comments,MIN(h.date_added) from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS_HISTORY . " h where o.date_purchased between '" . tep_db_input($startdate) . "' and '" . tep_db_input($enddate) . " 23:59:59' and h.orders_id = o.orders_id" . $pull_w_status . $get_customer_comments . ' group by o.orders_id');
The only change is that a space has been inserted before 23:59:59 , this allows the query to run correctly. It must have been a bug in mysql 3.x that allowed it run .. I can't say.
Make the above change and run the date search, it worked for me :)