# View all topics in category filter by date created

**URL:** https://meta.discourse.org/t/view-all-topics-in-category-filter-by-date-created/74009
**Category:** Support
**Created:** [2017 年 11 月 13 日午後 8:19 UTC](https://meta.discourse.org/t/view-all-topics-in-category-filter-by-date-created/74009 "2017-11-13T20:19:37Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Martin\_Cash](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin_cash/32/73218_2.png) [@Martin\_Cash](https://meta.discourse.org/u/Martin_Cash)
#### Post date: [2017 年 11 月 13 日午後 8:19 UTC](https://meta.discourse.org/t/view-all-topics-in-category-filter-by-date-created/74009/1 "2017-11-13T20:19:37Z")

</div>

I need to look through all topics that were created in a specific category within a specific date range. Any way to do that?

---

<div class="post-metadata">

### Author: ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)
#### Post date: [2017 年 11 月 13 日午後 8:39 UTC](https://meta.discourse.org/t/view-all-topics-in-category-filter-by-date-created/74009/2 "2017-11-13T20:39:00Z")

</div>

Do you have [Data Explorer](https://meta.discourse.org/t/32566?silent=true) installed? If so, this query by @simon will return all topics for a specific month, sorted by category. Would that do the trick?

```
-- [params]
-- int :months_ago = 1

WITH query_period as (
    SELECT
        date_trunc('month', CURRENT_DATE) - INTERVAL ':months_ago months' as period_start,
        date_trunc('month', CURRENT_DATE) - INTERVAL ':months_ago months' + INTERVAL '1 month' - INTERVAL '1 second' as period_end
)

SELECT
    t.id as topic_id,
    t.category_id
FROM topics t
RIGHT JOIN query_period qp
    ON t.created_at >= qp.period_start
        AND t.created_at <= qp.period_end
WHERE t.user_id > 0
    AND t.category_id IS NOT NULL
ORDER BY t.category_id, t.created_at DESC

```

(Note that we haven’t tested this yet so let us know if you have feedback).

---

<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: [2017 年 11 月 13 日午後 9:48 UTC](https://meta.discourse.org/t/view-all-topics-in-category-filter-by-date-created/74009/3 "2017-11-13T21:48:23Z")

</div>

If you click “options” after clicking the search 🔍 icon, you can search by date, category, and a bunch of other stuff.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2020 年 1 月 5 日午後 5:32 UTC](https://meta.discourse.org/t/view-all-topics-in-category-filter-by-date-created/74009/4 "2020-01-05T17:32:52Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2023 年 10 月 30 日午後 7:56 UTC](https://meta.discourse.org/t/view-all-topics-in-category-filter-by-date-created/74009/5 "2023-10-30T19:56:28Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2023 年 10 月 30 日午後 10:03 UTC](https://meta.discourse.org/t/view-all-topics-in-category-filter-by-date-created/74009/6 "2023-10-30T22:03:51Z")

</div>


