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: first of the year

Re: first of the year

From: Scott Mattes <Scott_at_TheMattesFamily.ws>
Date: Wed, 07 Jan 2004 14:37:35 GMT
Message-ID: <Xns94696205345F1ScottatTheMattesFami@24.48.107.54>


Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl> wrote in news:9h5nvv85j4u9sbbm598msd47gtofca0un2_at_4ax.com:

> On Tue, 6 Jan 2004 21:35:48 -0700, "Shawn" <spedwards_at_qwest.net>
> wrote:
> 

>>I have the below script. Every year we change the date (dpdate) in it
>>manually so it reflects the beginning of the current year.
>>I just haven't been able to figure it out. Any suggestions would be
>>greatly appreciated.
>>
>>select decode(pull_level,'G','UNWRAPPED','S','WRAPPED') x, ga_id,
>> prov_company,sum(amount) gloss
>>from std_invopt,event,acctg_txn_acty
>>where acctg_txn_acty.ev_id = event.id
>> and std_invopt.id = acctg_txn_acty.sdio_Id
>> and trunc(dpdate) >= '01-JAN-04'
>>GROUP BY
>>decode(pull_level,'G','UNWRAPPED','S','WRAPPED'),ga_id,prov_company
>>/
>>
>>
>>Thanks
>>

>
>>= trunc(sysdate,'YEAR')

But if run on any other day of the year problems could ensue, right? Maybe something like

to_date( to_char( Sysdate, 'yyyy' ) || '/01/01', 'yyyy/mm/dd' )

That way you always get Jan 1st of the current year. Received on Wed Jan 07 2004 - 08:37:35 CST

Original text of this message

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