Fix for bad SQL when using filter by date modified