adds date range to query