# Dashboard Report - Topics with No Response

**URL:** <https://meta.discourse.org/t/dashboard-report-topics-with-no-response/294002>\
**Category:** Data & reporting\
**Tags:** sql-query, dashboard-reports, dashboard-sql\
**Created:** [February 2, 2024, 10:55pm UTC](https://meta.discourse.org/t/dashboard-report-topics-with-no-response/294002 "2024-02-02T22:55:48Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![SaraDev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saradev/32/335139_2.png) [@SaraDev](https://meta.discourse.org/u/SaraDev)\
**Post date:** [September 4, 2024, 8:23pm UTC](https://meta.discourse.org/t/dashboard-report-topics-with-no-response/294002/8 "2024-09-04T20:23:34Z")

</div>

> [@SStrong](#):
>
> How am I able to change 10-22 to Oct-22?

To change the date format from `10-22` to `Oct-22` in PostgreSQL, you can use the `TO_CHAR` function. This function allows you to format dates in various ways, for example:

```sql
SELECT 
TO_CHAR(TO_DATE('10-22', 'MM-YY'), 'Mon-YY') AS formatted_date

```

In this SQL statement:

- `TO_DATE('10-22', 'MM-YY')` converts the string `10-22` into a date type using the format `MM-YY`.
- `TO_CHAR(..., 'Mon-YY')` then formats this date to display the abbreviated month name followed by the year, resulting in `Oct-22`.

Here’s another example of this based off of the version of the `Topics with No Response` query with the `interval` parameter shared above:

```sql
-- [params]
-- date :start_date = 2024-01-01    
-- date :end_date = 2025-01-01
-- null int :category_id
-- boolean :include_subcategories = false
-- text :interval = month

WITH no_response_total AS (
  SELECT *
  FROM (
    SELECT t.id, t.created_at, MIN(p.post_number) first_reply
    FROM topics t
    LEFT JOIN posts p ON p.topic_id = t.id AND p.user_id != t.user_id AND p.deleted_at IS NULL AND p.post_type = 1
    WHERE t.archetype <> 'private_message'
      AND t.deleted_at ISNULL
      AND (
        :category_id IS NULL
        OR t.category_id = :category_id
        OR (
          :include_subcategories
          AND t.category_id IN (
            SELECT id FROM categories WHERE parent_category_id = :category_id
          )
        )
      )
    GROUP BY t.id
  ) tt
  WHERE tt.first_reply IS NULL OR tt.first_reply < 2
)

SELECT 
  TO_CHAR(date_trunc(:interval, nrt.created_at)::date, 'Mon-YY') AS period, 
  COUNT(nrt.id) AS topics_without_response
FROM no_response_total nrt
WHERE nrt.created_at::date BETWEEN :start_date AND :end_date
GROUP BY period, date_trunc(:interval, nrt.created_at)::date
ORDER BY date_trunc(:interval, nrt.created_at)::date ASC

```

For reference, the results for this query would look like:

| period | topics\_without\_response |
| --- | --- |
| Dec-23 | 123 |
| Jan-24 | 455 |
| Feb-24 | 789 |
| … | … |

---

_[View the full topic](https://meta.discourse.org/t/dashboard-report-topics-with-no-response/294002)._
