Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: formatting month and date

Re: formatting month and date

From: Henning Follmann <henning_at_odin.follmann-net>
Date: Mon, 30 Jul 2001 17:11:45 -0400
Message-ID: <slrn9mbjch.fr.henning@odin.follmann-net>

On Mon, 30 Jul 2001 07:44:09 -0500, konopam <konopam_at_yahoo.com> wrote:

--cut--



>
>SELECT TRUNC(PLAN_S_DATE) as CallDate, Count(PLAN_S_DATE) AS TotalCalls
> FROM ACTIVE_SEPARATE
> WHERE (((ORG_CODE='613')
> OR (ORG_CODE='614')
> OR (ORG_CODE='618')))
>GROUP BY TRUNC(PLAN_S_DATE)
> HAVING TRUNC(PLAN_S_DATE) BETWEEN TO_DATE('&From_Date_MMDDYY','MMDDYY')
> AND TO_DATE('&To_Date_MMDDYY','MMDDYY')

If you use TO_Date without time it automatically creates the Date with time 00:00 h.
So your end date will not be in your resultset except you have a result wich is exactly at 00:00 h.
so try TO_CHAR(PLAN_S_DATE, 'YYYYMMDD') BETWEEN '20010101' AND '20010131' Which gives you the whole January set of 2001.

The other possibility is to increase the end date by 1.

henning

-- 
Henning Follmann
8 Jane Road
New Providence, NJ 07974
Tel.: +1 908 464 8972
H.Follmann_at_gmx.de


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----
Received on Mon Jul 30 2001 - 16:11:45 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US