Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Find First of Month
FireGeek wrote:
> Hey Everyone,
>
> Maybe I was not so clear in my original post. I need the FIRST OF THE
> MONTH following a given number of days. This is to determine when an
> employee's pension should start and when their 401k should start.
> Also, I need to pull salary information as well but it cannot include
> the first given number of days. Thus, I am looking for the "WEEK
> NUMBER" of this new start date.
>
> So, if a HIRE_DATE = 04/03/2006 and we are looking for a 401k start
> date then it is the FIRST OF THE MONTH after 90 days.
>
> NEW START DATE = LAST_DAY(ADD_MONTHS(E.HIRE_DT, 3))+1 = 08/01/2006
>
> WEEK NUMBER = TO_CHAR(LAST_DAY(ADD_MONTHS(E.HIRE_DT, 3))+1, 'IW')
>
> But for Pension I need the FIRST OF THE MONTH following 6 months.
>
> NEW START DATE = LAST_DAY(ADD_MONTHS(E.HIRE_DT, 6))+1 = 11/01/2006
>
> WEEK NUMBER = TO_CHAR(LAST_DAY(ADD_MONTHS(E.HIRE_DT, 6))+1, 'IW')
>
>
> FireGeek
THEN SYSDATE+<number_of_days>
THEN LAST_DAY
THEN add 1
Seems to me you have more than enough information to do this now yourself. If not then please submit a Request for Proposal (RFP) and we will be on doing your work for you. ;-)
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Sat Jul 15 2006 - 17:26:39 CDT