Hello,
I am trying to look for counts that are grouped by date vs. date time. For example, I am running the below query.
ALTER session SET NLS_DATE_FORMAT = 'mm/dd/yyyy';
select count(distinct contact_id) as counts, created as created_date
from s_con_chrctr
where created >= TO_CHAR('07/01/2015') and created <= TO_CHAR('07/10/2015')
and created_by = '1-J9455J'
group by created;
The results are as follows.
COUNTS | CREATED_DATE |
---|
1 | 07/02/2015 |
1 | 07/02/2015 |
1 | 07/02/2015 |
1 | 07/02/2015 |
I believe this is happening because this date column is a datetime column and its bringing back a record for each specific time within that day. The results I am looking for are...
COUNTS | CREATED_DATE |
---|
15 | 07/02/2015 |
17 | 07/03/2015 |
35 | 07/04/2015 |
11 | 07/05/2015 |
How would I change my query in order to group by the date and not by date time?