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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Selecting results for month to date

Re: Selecting results for month to date

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 6 Oct 2006 07:03:33 -0700
Message-ID: <1160143413.239612.60610@i3g2000cwc.googlegroups.com>

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



20061001 00:00:00

HTH -- Mark D Powell -- Received on Fri Oct 06 2006 - 09:03:33 CDT

Original text of this message

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