Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Selecting results for month to date
On Oct 6, 8:48 am, "VB" <vodkablo..._at_gmail.com> wrote:
> I have been asked to modify an existing report for deliveries in the
> last 24 hours to be deliveries for the month to date.
>
> At the moment the where statement includes sysdate -1
>
> Is there a more elegant way to select all diliveries after midnight on
> the first day of the month?
>
> Sorry to be an ignorant questioner, but our SQL person has left the
> company so all help is greatly appreciated.
Yes, just trunc the datetime value to get asking for the month format to get the first of the month that the datetime value falls into
1* select to_char( trunc(sysdate,'MM'), 'YYYYMMDD HH24:MI:SS') from
sys.dual
UT1 > /
TO_CHAR(TRUNC(SYS
HTH -- Mark D Powell -- Received on Fri Oct 06 2006 - 09:03:33 CDT
![]() |
![]() |