Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Trunc Function formatting for dates
Try
select to_char(sysdate,'MM-DD-YYYY') FROM DUAL;
TO_CHAR(SY
Vladimir Ivanovich
"Andy" <andy.konopka_at_camtronics.com> wrote in message
news:FE_07.17$Z9.60_at_client...
> I was wondering if anyone could assist in getting a date to format using
the
> TRUNC function with this query
>
> 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')
>
>
> this is the 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
>
> Here is the desired output
> Date Total Calls
> 05-22-2001 1
> 05-23-2001 1
> 05-29-2001 1
> 06-01-2001 2
> 06-04-2001 2
> 06-05-2001 1
> 06-12-2001 1
> 06-19-2001 3
>
>
>
>
Received on Thu Jul 05 2001 - 09:50:06 CDT