Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> format date using Trunc
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
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 3Received on Mon Jun 25 2001 - 08:46:47 CDT
![]() |
![]() |