# Incorrect Group by Date

**URL:** <https://community.spicecrm.io/t/incorrect-group-by-date/360>\
**Category:** KReporter\
**Created:** [October 19, 2018, 5:29pm UTC](https://community.spicecrm.io/t/incorrect-group-by-date/360 "2018-10-19T17:29:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tessupport](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@tessupport](https://community.spicecrm.io/u/tessupport)\
**Post date:** [October 19, 2018, 5:29pm UTC](https://community.spicecrm.io/t/incorrect-group-by-date/360/1 "2018-10-19T17:29:54Z")

</div>

We have an issue where we wanted to view Cases opened by Date (Grouped). Noticed that a Case created on 10/7/18 at 8:47 pm was in the Created on 10/8 group. Does kReporter operate on a different base time zone that might have caused this?

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [October 21, 2018, 6:45pm UTC](https://community.spicecrm.io/t/incorrect-group-by-date/360/2 "2018-10-21T18:45:12Z")

</div>

KReporter groups on date value saved in database.  
For display date is re-calculated for user’s timezone.

In the example balow Case 25 was created 2016-08-23 at 11:30 pm.  
It will belong to August 23rd for query, but date will be displayed for the user in August 24th. The user has git timezone gmt +4 .  
 ![grafik](https://canada1.discourse-cdn.com/flex030/uploads/spicecrm/original/1X/bbebb115c170de25bfddff561ebcb92b935dbea2.png)

---

<div class="post-metadata">

**Author:** ![tessupport](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@tessupport](https://community.spicecrm.io/u/tessupport)\
**Post date:** [October 24, 2018, 3:19pm UTC](https://community.spicecrm.io/t/incorrect-group-by-date/360/3 "2018-10-24T15:19:53Z")

</div>

Hey Val,

I was able to use Inserted DATE\_FORMAT(CONVERT\_TZ({t}.{f},’+00:00’,’-05:00’),’%Y-%m-%d’) and correctly assigned cases per current time zone. Just fyi
