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: defaulting to the beginning of the year

Re: defaulting to the beginning of the year

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 25 Jan 2003 17:20:54 -0800
Message-ID: <92eeeff0.0301251720.4671869@posting.google.com>


"Shawn Edwards" <spedwards_at_qwest.net> wrote in message news:<hqBY9.32$x33.81462_at_news.uswest.net>...
> Hi,
>
> I have the below script in which I have been updating the 'effdate' to the
> beginning of the year, each year.
> Is there a way for me to fix the script so that I don't have to update
> manually each year and it just
> defaults to the beginning of the year?
>
> Thanks
>
>
> select decode(pull_level,'G','UNWRAPPED','S','WRAPPED') x,
> prov_company,sum(gain_loss_amt) gloss
> from work_glrp, event, inv_pull, std_invopt
> where work_glrp.ev_id = event.id
> and std_invopt.id = work_glrp.sdio_Id
> and (gain_loss_rsn_code not in ('NR','NC','NT','NF')
> or gain_loss_rsn_code is null)
> and ((std_invopt.pull_level = 'G'
> and work_glrp.ivpl_effdate >= '01-JAN-03'
> and inv_pull.id = work_glrp.ivpl_id)
> or
> (std_invopt.pull_level = 'S'
> and work_glrp.ivpl_effdate >= '01-JAN-03'
> and inv_pull.id = work_glrp.ivpl_id))
> GROUP BY decode(pull_level,'G','UNWRAPPED','S','WRAPPED'),prov_company
> /

One way is,

and work_glrp.ivpl_effdate >= TO_DATE('01JAN' || TO_CHAR(sysdate, 'YYYY'), 'DDMONYYYY') Regards
/Rauf Sarwar Received on Sat Jan 25 2003 - 19:20:54 CST

Original text of this message

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