Fix for date query.