Fix date range query.