# How to group by date only in data explorer

**URL:** <https://meta.discourse.org/t/how-to-group-by-date-only-in-data-explorer/92868>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [7월 22, 2018, 4:45오전 UTC](https://meta.discourse.org/t/how-to-group-by-date-only-in-data-explorer/92868 "2018-07-22T04:45:17Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [7월 22, 2018, 5:19오전 UTC](https://meta.discourse.org/t/how-to-group-by-date-only-in-data-explorer/92868/3 "2018-07-22T05:19:50Z")

</div>

You want to round the datetime to the day. See

> **[9.9. Date/Time Functions and Operators](https://www.postgresql.org/docs/8.4/functions-datetime.html)**
>
> 9.9. Date/Time Functions and Operators # 9.9.1. EXTRACT, date\_part 9.9.2. date\_trunc 9.9.3. date\_bin 9.9.4. AT TIME ZONE and AT LOCAL 9.9.5. …

I am on my phone, so can’t (or won’t) do a full solution, but this should get you close

```
SELECT EXTRACT(DOY FROM created_at) as day

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-group-by-date-only-in-data-explorer/92868)._
