# Select events from a topic between two dates without emitting changes

**URL:** <https://forum.confluent.io/t/select-events-from-a-topic-between-two-dates-without-emitting-changes/1128>\
**Category:** ksqlDB\
**Created:** [5 March 2021 16:25 UTC](https://forum.confluent.io/t/select-events-from-a-topic-between-two-dates-without-emitting-changes/1128 "2021-03-05T16:25:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcotomasrodriguez](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/marcotomasrodriguez/32/586_2.png) [@marcotomasrodriguez](https://forum.confluent.io/u/marcotomasrodriguez)\
**Post date:** [5 March 2021 16:25 UTC](https://forum.confluent.io/t/select-events-from-a-topic-between-two-dates-without-emitting-changes/1128/1 "2021-03-05T16:25:11Z")

</div>

Hello,

I am developing an historical information endpoint, so the user can select a device id and see when it was online/offline (daily). So, I would like to select all the events with the same key between two dates from a Kafka topic in ksqlDB without emitting changes. I find the “tumbling window pull query” feature (kind of) similar, but it seems to me that it is only for aggregated data.  
Which feature should I use?

Here is a simplified example of the data that I am using:

```auto
CREATE STREAM gateway_connections_daily (
    gatewayid VARCHAR KEY,
    connection VARCHAR
) WITH (
    kafka_topic='gateway.fct.connection.0',
    value_format='JSON'
);

```

Thanks for all in advance.

---

<div class="post-metadata">

**Author:** ![rmoff](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/rmoff/32/3_2.png) [@rmoff](https://forum.confluent.io/u/rmoff)\
**Post date:** [8 March 2021 10:09 UTC](https://forum.confluent.io/t/select-events-from-a-topic-between-two-dates-without-emitting-changes/1128/3 "2021-03-08T10:09:45Z")

</div>

Hi, from the sounds of it a table will be appropriate here, but it’s hard to say for sure without a better understanding of the data. Can you share a sample of data (dummy, if necessary) and expected output?

---

<div class="post-metadata">

**Author:** ![mjsax](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/mjsax/32/3113_2.png) [@mjsax](https://forum.confluent.io/u/mjsax)\
**Post date:** [9 March 2021 01:41 UTC](https://forum.confluent.io/t/select-events-from-a-topic-between-two-dates-without-emitting-changes/1128/4 "2021-03-09T01:41:35Z")

</div>

I think this is not supported atm. You would currently issue a push query over the stream, but would need to terminate the query manually, after it reached the end of the topic and thus does not return any more data (it’s of course tricky to know when the end of the topic is reached…).

We did discuss this use case in the past, but not many people requested such a feature yet. Good to know that there would be interest.
