# עזרה עם SQL - סגירה אוטומטית/תוצאות חוזרות/סינון שבועי

**URL:** <https://meta.discourse.org/t/help-with-sql-autoclose-repeat-results-week-filter/231038>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [24 ביוני,‏ 2022,‏ 5:25pm UTC](https://meta.discourse.org/t/help-with-sql-autoclose-repeat-results-week-filter/231038 "2022-06-24T17:25:17Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [24 ביוני,‏ 2022,‏ 7:19pm UTC](https://meta.discourse.org/t/help-with-sql-autoclose-repeat-results-week-filter/231038/4 "2022-06-24T19:19:41Z")

</div>

My guess on (3) is that it’s a time zone issue, and/or that it’s based on the second that you run the script and you want the previous or next midnight. (Not quite sure how to fix either of those offhand).

Not sure if this’ll help but you can try

To get when they’re going to close, you’d need to add something to the `SELECT` part (which you can infer from the available fields) and change `FROM` like

```
   FROM topics t, discourse_voting_topic_vote_count dvc, topic_timers tt

```

and add this after `WHERE`

```plaintext
    AND tt.topic_id=t.id

```

(just like the one you added before).

---

_[View the full topic](https://meta.discourse.org/t/help-with-sql-autoclose-repeat-results-week-filter/231038)._
