Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: defaulting to the beginning of the year
On Sat, 25 Jan 2003 12:18:13 -0700, "Shawn Edwards"
<spedwards_at_qwest.net> wrote:
>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
>/
>
Sure
Use trunc(sysdate,'YYYY') and you won't have to change it anymore.
Sybrand Bakker, Senior Oracle DBA
To reply remove -verwijderdit from my e-mail address Received on Sat Jan 25 2003 - 14:35:02 CST