Re: Query will not total counts of a date

From: Beth Katcher <b.katcher_at_rcn.com>
Date: Wed, 21 Feb 2001 12:42:51 -0500
Message-ID: <3A93FE1B.C9C0D47A_at_rcn.com>


The problem is that date fields include time information. So while you have two records that look like they have identical dates (i.e., the day, month, and year are the same) the dates aren't really identical because they have different time information. Hence they are not "grouping."

The solution is to trunc the date.

  • Beth

Andy Konopka wrote:
>
> Hello All, I was wondering what little stupid thing I was doing wrong in the
> following query???
> I would appreciate any feedback
> SELECT PLAN_S_DATE, Count(PLAN_S_DATE) AS TotalCalls
> FROM ACTIVE_SEPARATE
> WHERE (((ORG_CODE)='613'
> Or (ORG_CODE) = '614'
> Or (ORG_CODE) = '618'))
> GROUP BY PLAN_S_DATE;
>
> Expected Results Actual Results
> 09-JAN-01 2 09-JAN-01 1
> 10-JAN-01 1 09-JAN-01 1
> 16-JAN-01 1 16-JAN-01 1
> 18-JAN-01 2 18-JAN-01 1
> 18-JAN-01
> 1
Received on Wed Feb 21 2001 - 18:42:51 CET

Original text of this message