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 -> format date using Trunc

format date using Trunc

From: Andy <andy.konopka_at_camtronics.com>
Date: Mon, 25 Jun 2001 08:46:47 -0500
Message-ID: <cfHZ6.12$9R5.287@client>

Is there anyway to format this SQL to produce the desired output from this query? It appears that you can put a oracle function around the truncate or use anything to get the desired output;

SELECT TRUNC(PLAN_S_DATE) as CallDate, Count(*) AS TotalCalls

    FROM ifsapp.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')

CURRENT OUTPUT:
Date                            Total Calls
2001-05-22-00.00.00 1
2001-05-23-00.00.00 1
2001-05-29-00.00.00 1
2001-06-01-00.00.00 2
2001-06-04-00.00.00 2
2001-06-05-00.00.00 1

2001-06-12-00.00.00 1
2001-06-19-00.00.00 3

DESIRED OUTPUT:
Date Total Calls

2001-05-22 1
2001-05-22 1
2001-05-29 1
2001-06-01 2
2001-06-04 2
2001-06-05 1
2001-06-12 1
2001-06-19 3
Received on Mon Jun 25 2001 - 08:46:47 CDT

Original text of this message

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