Modified the query to restrict the query results according to the
specified start and end dates