Ensure that all date-based queries are appropriately handling boundary conditions - REPORT-166

https://tickets.openmrs.org/browse/REPORT-166