Max Effective Date in Discoverer

How do you make Discoverer get the row that has the max effective dated record to return for each person? For example, if the report is bringing back a person with 3 rows and you want the row that has the max effective date, what condition do I use for this? If I use MAX(), then it brings back the max date of all the records and I need just the one for each person.

Post your questions here:
Discoverer
Check this if this helps:
Re: Implementing HR report in Discoverer

Similar Messages

  • Max Effective Date

    HI, I need to return latest or maximum effective date.  Query returns multiple row for same condition and different eff date. I need to to return latest date from that range. I can only use Query Manger (PeopleSoft 9.0). How can I do it? If I select
    MAX, it does not return any value.
    eg. I need to return only 7/9/2011 row.
    SELECT DISTINCT A.EMPLID, TO_CHAR(A.EFFDT,'YYYY-MM-DD'), A.CHANGE_AMT
      FROM PS_JOB A
      WHERE A.EMPLID = '00001'
         AND ( A.CHANGE_AMT <> 0.00)
      ORDER BY 2 DESC
    ID
                Eff Date
                                      Chng Amt
    00001
    7/9/2011
    8199.490000
    00001
    6/9/2007
    1508.750000
    00001
    3/10/2001
    1464.810000
    00001
    12/16/2000
    3825.150000
    00001
    4/8/2000
    3601.800000

    Hi:
    SELECT  A.EMPLID, TO_CHAR(A.EFFDT,'YYYY-MM-DD'), A.CHANGE_AMT
      FROM PS_JOB A
      WHERE A.EMPLID = '00001'  and EFFDT=(select max(EFFDT) FROM PS_JOB WHERE EMPLID = '00001')
         AND ( A.CHANGE_AMT <> 0.00)
      ORDER BY 2 DESC
    Only if you need a 1 EMPLID if you need more that 1 use INNER JOIN with a subquery
    JM Claudio Dba/Consultor SQL/BI Pasiona - Spain

  • How to create a filter based on Effective date EFFDT

    Hello to all,
    I am currently creating reports from an HR database that stores records by employee (EMPLID) based on effective date(EFFDT) and Effective Sequence (EFFSEQ).
    It is easy to get a report that shows all entries up to a certain data (using <= or >=), however, I am not able to create a Filter (in the report or in the prompt)
    that shows me the MAX(EFFDT) up to a certain data dd/mm/yyyy. (any one)
    The sql script we use is the follwiing
    SELECT A.EFFDT, A.EFFSEQ, A.ACTION, A.EMPL_CLASS, *
    FROM PS_JOB A
    WHERE A.EMPLID=' ' ----*(PROMPT1)*
    AND A.EFFDT=(SELECT MAX(B.EFFDT) FROM PS_JOB B
    WHERE B.EMPLID=A.EMPLID
    AND B.EFFDT<=' ') *(PROMPT2)*
    AND A.EFFSEQ=(SELECT MAX(B.EFFSEQ) FROM PS_JOB B
    WHERE B.EMPLID=A.EMPLID
    AND B.EFFDT=A.EFFDT)
    Do I need to create a variable? If yes, How?
    Please send me your suggestions or past experiences with BI on the subject.
    Thanks
    Roberto

    Hi Roberto,
    I would create a session variable via the Oracle BI Administration Tool.
    See the following of how to achieve this:
    http://download.oracle.com/docs/cd/E12096_01/books/admintool/admintool_Variables4.html
    Reference this variable in your filter. It looks something like this VALUEOF(NQ_SESSION."VARIABLE_NAME")
    Good Luck,
    Daan Bakboord

  • How to Displaying Operating specific data in Discoverer Reports.....?

    Hi Experts,
    My Requirement : I need to develope one custom report where it has to display operating unit specific data based on the resposibility selection in Discoverer.
    My Approach : I prepared the below query and I am trying to pick Business_group_id from profile options and passing to the query.(You can observe the condition which is highlighted as red color)While i am running the query I am getting zero records.
    Please suggest me how to achieve the my requirement of displaying operating unit specific data in Discoverer.
    SELECT  A1.PERSON_ID
           ,A1.employee_number
           ,A1.first_name
           ,A1.last_name
           ,A1.known_as PREFERRED_NAME
           ,A1.GENDER
           ,A1.date_of_birth
           ,A1.Marital_status
           ,A1.original_date_of_hire
           ,A1.Organization
           ,A1.Location
           ,A1.Job_name
           ,A1.OLF_DEPARTMENT
           ,A1.OLF_DEPT_SUBGROUP
           ,A1.salary
           ,A1.salary_change_date
           ,A1.HIRE_DATE
           ,A2.PERSON_ID SUPERVISOR_ID
           ,A2.EMPLOYEE SUPERVISOR
           ,A3.PERSON_ID SUPERVISOR_ID_1
           ,A3.EMPLOYEE SUPERVISOR_NAME_1 
    FROM (
    SELECT PAPF.first_name
          ,PAPF.last_name
          ,papf.known_as
          ,papf.*** GENDER
          ,papf.date_of_birth
          ,papf.marital_status
          ,papf.employee_number
          ,PAPF.person_id
          ,PAAF.supervisor_id     
          ,PAPF.original_date_of_hire
          ,(SELECT name FROM  hr_all_organization_units WHERE Organization_id=PAAF.organization_id) Organization
          ,(SELECT location_code FROM  hr_locations WHERE location_id=PAAF.Location_id) Location
          ,(SELECT name FROM  per_jobs WHERE job_id=PAAF.job_id) Job_name
          ,PPP.proposed_salary_n SALARY
          ,ppp.change_date salary_change_date
          ,ppgk.segment1   OLF_DEPARTMENT
          ,ppgk.segment2  OLF_DEPT_SUBGROUP
          ,papf.original_date_of_hire HIRE_DATE
      FROM per_all_people_f PAPF 
          ,per_all_assignments_f PAAF
          ,per_pay_proposals  PPP
          ,PAY_PEOPLE_GROUPS_KFV ppgk
    WHERE 1=1
       AND PAPF.person_id=PAAF.person_id
       AND papf.business_group_id=paaf.business_group_id
       AND PAAF.assignment_id=PPP.assignment_id
       AND paaf.people_group_id=ppgk.people_group_id
       AND ppp.change_date =(SELECT MAX(change_date)
                               FROM per_pay_proposals
                              WHERE assignment_id=PPP.assignment_id)
       AND SYSDATE BETWEEN PAPF.effective_start_date AND PAPF.effective_end_date
       AND SYSDATE BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date<font color="red">AND PAPF.BUSINESS_GROUP_ID = TO_NUMBER(FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID '))</font>
    ) A1
    SELECT PAPF.first_name
    ||','||PAPF.last_name EMPLOYEE,PAPF.PERSON_ID,PAAF.supervisor_id
    FROM per_all_people_f PAPF
    ,per_all_assignments_f PAAF
    WHERE PAPF.person_id=PAAF.person_id
    AND papf.business_group_id=paaf.business_group_id
    AND SYSDATE BETWEEN PAPF.effective_start_date AND PAPF.effective_end_date
    AND SYSDATE BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
    ) A2
    SELECT PAPF.first_name
    ||','||PAPF.last_name EMPLOYEE
    ,PAPF.PERSON_ID
    ,PAAF.supervisor_id
    FROM per_all_people_f PAPF
    ,per_all_assignments_f PAAF
    WHERE PAPF.person_id=PAAF.person_id
    AND papf.business_group_id=paaf.business_group_id
    AND SYSDATE BETWEEN PAPF.effective_start_date AND PAPF.effective_end_date
    AND SYSDATE BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
    ) A3
    WHERE 1=1
    AND A2.PERSON_ID(+)=A1.SUPERVISOR_ID
    AND A3.PERSON_ID(+)=A2.SUPERVISOR_ID
    AND A4.PERSON_ID(+)=A3.SUPERVISOR_ID
    ;

    Pl identify versions of OS, database, EBS and Discoverer. Have you reviewed these MOS Docs ?
    373634.1 - Using Discoverer 10.1.2 with Oracle E-Business Suite Release 12
    1074326.1 - Using Discoverer 11.1.1 with Oracle E-Business Suite Release 12
    313418.1 - Using Discoverer 10.1.2 with Oracle E-Business Suite 11i
    1073963.1 - Using Discoverer 11.1.1 with Oracle E-Business Suite Release 11i
    HTH
    Srini

  • Outer join with effective date in peoplesoft query

    Hi,
    I'm trying to join two tables using outer join. Both tables are effective dated:
    Dept_Tbl: dept_id, status, effdt
    Tips_Tbl: dept_id, tips_id, effdt
    Not all records in Dept_Tbl are in Tips_Tbl. I need to get all active depts and their most recent tips_id if they have one.
    select a.dept_id, b.tips_id
    from dept_tbl a, tips_tbl b
    where a.status = 'Active'
    and a.effdt =
    (select max(a_ed.effdt) from dept_tbl a_ed
    where a.dept_id = a_ed.dept_id
    and a_ed.effdt <= SYSDATE)
    and b.dept_id(+) = a.dept_id
    and b.effdt =
    (select max(b_ed.effdt) from tips_tbl b_ed
    where b.dept_id = b_ed.dept_id
    and b.tips_id = b_ed.tips_id
    and b_ed.effdt <= SYSDATE)
    The query only returns records that are in both tables.
    Is there a way for outer join to work with effective dates?
    Thanks in advance,
    Reg

    Here is an example of one solution. Note the use of NVL on both sides of the equal sign since both sides could be NULL in the case of the outer join
    with dept_tbl as (select 1 dept_id, SYSDATE effdt FROM DUAL),
         tips_tbl as (select 1 dept_id, NULL effdt FROM DUAL)
    select a.effdt
      from dept_tbl a,
           tips_tbl b
    where b.dept_id(+) = a.dept_id
       and NVL(b.effdt, SYSDATE) = NVL((select max(b_ed.effdt)
                                          from tips_tbl b_ed
                                         where b.dept_id = b_ed.dept_id
                                           and b_ed.effdt <= SYSDATE), SYSDATE);
    EFFDT
    5/7/2007 3:25:00 PM

  • Displaying operating unit specific data in Discoverer Report ????

    Hi Experts,
    My Requirement : I need to develope one custom report where it has to display operating unit specific data based on the resposibility selection in Discoverer.
    My Approach : I prepared the below query and I am trying to pick Business_group_id from profile options and passing to the query.(You can observe the condition which is highlighted as red color)While i am running the query I am getting zero records.
    Please suggest me how to achieve the my requirement of displaying operating unit specific data in Discoverer.
    SELECT  A1.PERSON_ID
           ,A1.employee_number
           ,A1.first_name
           ,A1.last_name
           ,A1.known_as PREFERRED_NAME
           ,A1.GENDER
           ,A1.date_of_birth
           ,A1.Marital_status
           ,A1.original_date_of_hire
           ,A1.Organization
           ,A1.Location
           ,A1.Job_name
           ,A1.OLF_DEPARTMENT
           ,A1.OLF_DEPT_SUBGROUP
           ,A1.salary
           ,A1.salary_change_date
           ,A1.HIRE_DATE
           ,A2.PERSON_ID SUPERVISOR_ID
           ,A2.EMPLOYEE SUPERVISOR
           ,A3.PERSON_ID SUPERVISOR_ID_1
           ,A3.EMPLOYEE SUPERVISOR_NAME_1 
    FROM (
    SELECT PAPF.first_name
          ,PAPF.last_name
          ,papf.known_as
          ,papf.sex GENDER
          ,papf.date_of_birth
          ,papf.marital_status
          ,papf.employee_number
          ,PAPF.person_id
          ,PAAF.supervisor_id     
          ,PAPF.original_date_of_hire
          ,(SELECT name FROM  hr_all_organization_units WHERE Organization_id=PAAF.organization_id) Organization
          ,(SELECT location_code FROM  hr_locations WHERE location_id=PAAF.Location_id) Location
          ,(SELECT name FROM  per_jobs WHERE job_id=PAAF.job_id) Job_name
          ,PPP.proposed_salary_n SALARY
          ,ppp.change_date salary_change_date
          ,ppgk.segment1   OLF_DEPARTMENT
          ,ppgk.segment2  OLF_DEPT_SUBGROUP
          ,papf.original_date_of_hire HIRE_DATE
      FROM per_all_people_f PAPF 
          ,per_all_assignments_f PAAF
          ,per_pay_proposals  PPP
          ,PAY_PEOPLE_GROUPS_KFV ppgk
    WHERE 1=1
       AND PAPF.person_id=PAAF.person_id
       AND papf.business_group_id=paaf.business_group_id
       AND PAAF.assignment_id=PPP.assignment_id
       AND paaf.people_group_id=ppgk.people_group_id
       AND ppp.change_date =(SELECT MAX(change_date)
                               FROM per_pay_proposals
                              WHERE assignment_id=PPP.assignment_id)
       AND SYSDATE BETWEEN PAPF.effective_start_date AND PAPF.effective_end_date
       AND SYSDATE BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date<font color="red">AND PAPF.BUSINESS_GROUP_ID = TO_NUMBER(FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID '))</font>
    ) A1
    SELECT PAPF.first_name
    ||','||PAPF.last_name EMPLOYEE,PAPF.PERSON_ID,PAAF.supervisor_id     
      FROM per_all_people_f PAPF
          ,per_all_assignments_f PAAF
    WHERE PAPF.person_id=PAAF.person_id
    AND papf.business_group_id=paaf.business_group_id
       AND SYSDATE BETWEEN PAPF.effective_start_date AND PAPF.effective_end_date
       AND SYSDATE BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
    ) A2
    SELECT PAPF.first_name
    ||','||PAPF.last_name EMPLOYEE
         ,PAPF.PERSON_ID
          ,PAAF.supervisor_id     
      FROM per_all_people_f PAPF
          ,per_all_assignments_f PAAF
    WHERE PAPF.person_id=PAAF.person_id
    AND papf.business_group_id=paaf.business_group_id
       AND SYSDATE BETWEEN PAPF.effective_start_date AND PAPF.effective_end_date
       AND SYSDATE BETWEEN PAAF.effective_start_date AND PAAF.effective_end_date
    ) A3 
    WHERE 1=1
    AND  A2.PERSON_ID(+)=A1.SUPERVISOR_ID
    AND  A3.PERSON_ID(+)=A2.SUPERVISOR_ID
    AND  A4.PERSON_ID(+)=A3.SUPERVISOR_ID
    ;

    you are in the wrong forum, try an ebusiness-related forum, maybe this OA Framework

  • Effective date for a record

    Hello Experts,
    I am working on a project, where there is a requirement to hide the record till the effective date is kicked-off. For example, if I create the product record on 20-Jun-08 and mention the effective date as 20-Jul-2008, the record should not be available for any searches, syndication, etc.
    Please let me know, if MDM supports this kind of a feature or going to support in any future releases?
    Note: We are using MDM 5.5 with SP6
    Thanks,
    Surendra

    This is a very valid requirement for Material/Products business areas. We had a similar reqmnt earlier and what we did was to form a custom search application using Java API. So whatever parameters user passes to MDM, internally we also used to pass SYSDATE and compare this Sysdate to Effective Date. On this basis we could search only for valid products.
    And its a pretty simple application. Developers can build this within a week max!
    Hope this helps...

  • SQL command to get latest effective date

    Hi!
    How can i want to write a sql command to fetch records as such
    Vendor;    Item;     EffectiveDate;    UnitPrice;    Remarks
    Vend1;      ABC;    31/01/2012;        120;            Dont show
    Vend1;      ABC;    29/02/2012;        150;            Show
    Vend2;      ABC;    01/01/2012;        140;            Show
    Vend1;      XYZ;    15/01/2012;        100;            Show
    Please help me, so far I can only figuire out how to get the latest effective date by vendor and item but was not able to get UnitPrice
    SELECT  "VendPart"."Vendor", "VendPart"."Item", Max("VendPart"."EffectiveDate") AS MaxOfEffectiveDate
    FROM   "POS_LiveRpt"."dbo"."VendPart" "VendPart"
    GROUp BY "VendPart"."Vendor", "VendPart"."Item"
    Edited by: MichellePoh on Feb 23, 2012 9:58 AM

    hi Michelle,
    you can use a subquery in your command to bring back the UnitPrice that is applicable to the max date...see the code below for an idea.
    you'll have to change the "UnitPrice" field below to match yours.
    note that in the subquery the vendpart table has been aliased as vendpart2 for the subquery to work. also note that the code may not work in your database as Alan aluded to the fact that the syntax is specific to the database type...if you get any database errors please refer to your database manual or a forum for your database type that has a subquery. and of course there may be errors from my typing in the query as it's just being done inside this forum thread...but hopefully this will give you an idea how to do this.
    cheers,
    jamie
    SELECT 
    "VendPart"."Vendor",
    "VendPart"."Item",
    Max("VendPart"."EffectiveDate") AS MaxOfEffectiveDate,
    SELECT "VendPart2"."UnitPrice"
    FROM "POS_LiveRpt"."dbo"."VendPart" "VendPart2"
    WHERE "VendPart2"."EffectiveDate" = Max("VendPart"."EffectiveDate")
    AND  "VendPart2"."Vendor" =  "VendPart"."Vendor"
    AND "VendPart2"."Item" = "VendPart"."Item"
    ) AS UnitPrice
    FROM  
    "POS_LiveRpt"."dbo"."VendPart" "VendPart"
    GROUp BY
    "VendPart"."Vendor", "VendPart"."Item"

  • Table for Job effective date

    Please let me know the table and field for the Effective date the employee moved into the job
    Lisa

    Hi Lisa,
    the fileds BEGDA and ENDDA represent the Effective date and end date of the EE assigned to the Job
    Thanks
    Cheera

  • Windows 8.1/Server 2012 R2 Exams - EFFECTIVE DATE ADJUSTED!

    Hi, everyone.
    Microsoft has adjusted the effective starting date of when the Windows 8.0 exams and Windows Server 2012 exams will be updated to Windows 8.1 and Windows Server 2012 R2 at Prometric.
    The new effective date is January 28, 2014.
    This means that current study materials for many of these exams remain current. You have a little extra time to pass these exams before they are updated.
    Which exams specifically? Other questions? Learn more or ask questions at the following blog entry:
    http://borntolearn.mslearn.net/btl/b/weblog/archive/2014/01/09/mcsa-windows-8-and-mcsa-windows-server-2012-exams-to-be-updated-january-28-2014.aspx
    Good luck!
    Best wishes, Davin Mickelson

    Hi, Ken.
    Unfortunately, this exam will be updated on January 28th, 2012 to Windows Server 2012 R2 and Windows 8.1.
    It's too bad that Microsoft did not update the 70-417 exam description to tell you that. I know they
    did update the exam descriptions for the other core exams, like 70-410.
    70-410
    http://www.microsoft.com/learning/en-us/exam-70-410.aspx
    70-417 UPGRADE
    http://www.microsoft.com/learning/en-us/exam-70-417.aspx
    You have three painful choices:
    Just take it anyway. Know that only some of the exam questions were updated. You can also learn what they are testing you for on the exam. You may even get lucky and still pass. You do have four (4) days to cram.
    Reschedule the exam while paying that $35 reschedule fee.
    Cancel the exam.
    New study books will be released this spring. Here is the list from O'Reilly:
    http://search.oreilly.com/?q=%22Server+2012+R2%22+exam&x=9&y=15
    Sorry that Microsoft didn't update the exam's description.  That's why I had the post turned into a sticky.
    Good luck with your decision and with your exams.
    Best wishes, Davin Mickelson

  • GL Trial Balance Report with Effective Dates as Parameters

    We have a requirement to show the GL Trial Balance report with Effective dates as Parameters.
    Current Analysis:
    The Journals get updated with corresponding CCID in GL_BALANCES table when the Journal is posted. GL_BALANCE is SOB specific, if the SOB has month as period then the balances in GL_BALANCES would get updated against the month(period).
    To overcome the period problem, we explored the option of using a View based on GL_JE_HEADERS and GL_JE_LINES for 'Posted' Journal Batches of a SOB. We are checking whether the GL_JE_HEADERS.default_effective_date lies between the :p_from_date and :p_to_date which is sent to the Report as a parameter. The above idea does not return expected data when the custom Trial Balance Report is run.
    Following is the Query being used:
    SELECT cc.segment4 ACCOUNT, bal.code_combination_id,
    bal.begin_balance_dr
    + SUM (NVL (gljel.accounted_dr, 0)) opening_bal_dr,
    bal.begin_balance_cr
    + SUM (NVL (gljel.accounted_cr, 0)) opening_bal_cr,
    ffv.description,
    (SELECT SUM (NVL (gljel.accounted_dr, 0))
    FROM gl_je_headers gljeh,
    gl_je_lines gljel,
    gl_code_combinations gcc
    WHERE gljeh.default_effective_date BETWEEN :p_from_date
    AND :p_to_date
    AND gljeh.je_header_id = gljel.je_header_id
    AND gljel.code_combination_id = gcc.code_combination_id
    AND gljel.period_name = gljeh.period_name
    AND gljel.set_of_books_id = :p_set_of_books_id
    AND gljeh.status = 'P'
    AND gljel.status = 'P'
    AND gljeh.actual_flag = 'A'
    --AND gljel.code_combination_id =
    -- bal.code_combination_id
    AND gcc.segment4 = cc.segment4
    GROUP BY gcc.segment4) c_dr,
    (SELECT SUM (NVL (gljel.accounted_cr, 0))
    FROM gl_je_headers gljeh,
    gl_je_lines gljel,
    gl_code_combinations gcc
    WHERE gljeh.default_effective_date BETWEEN :p_from_date
    AND :p_to_date
    AND gljeh.je_header_id = gljel.je_header_id
    AND gljel.period_name = gljeh.period_name
    AND gljel.code_combination_id = gcc.code_combination_id
    AND gljel.set_of_books_id = :p_set_of_books_id
    AND gljeh.status = 'P'
    AND gljel.status = 'P'
    AND gljeh.actual_flag = 'A'
    AND gcc.segment4 = cc.segment4
    GROUP BY gcc.segment4) c_cr
    FROM gl_period_statuses per,
    gl_code_combinations cc,
    gl_balances bal,
    gl_je_headers gljeh,
    gl_je_lines gljel,
    fnd_flex_values_vl ffv,
    fnd_flex_value_sets ffvs
    WHERE cc.chart_of_accounts_id = :p_chart_of_accts_id
    AND bal.currency_code = :p_currency
    AND bal.actual_flag = 'A'
    AND bal.period_name = per.period_name
    AND cc.template_id IS NULL
    AND cc.code_combination_id = bal.code_combination_id
    AND per.set_of_books_id = :p_set_of_books_id
    AND per.application_id = 101
    AND :p_from_date BETWEEN per.start_date AND per.end_date
    AND gljeh.period_name = per.period_name
    AND gljeh.default_effective_date <= :p_from_date
    AND gljeh.je_header_id = gljel.je_header_id
    AND gljel.period_name = gljeh.period_name
    AND gljel.set_of_books_id = :p_set_of_books_id
    AND ffv.flex_value_set_id = ffvs.flex_value_set_id
    AND ffvs.flex_value_set_name = 'JSWEL_ACCOUNT'
    AND gljeh.status = 'P'
    AND gljel.status = 'P'
    AND cc.summary_flag = ffv.summary_flag
    AND cc.segment4 = ffv.flex_value
    AND gljeh.actual_flag = 'A'
    AND gljel.code_combination_id = bal.code_combination_id
    GROUP BY bal.begin_balance_dr,
    bal.begin_balance_cr,
    cc.segment4,
    ffv.description,
    bal.code_combination_id
    Kindly suggest if I am missing anything. I am sure that the great guns here can help me out.
    Thanks
    Sumit

    suggest to create customize TB report.

  • Inserting rows in cursor and breaking up when effect date matches

    Hi
    I have created a table cadreinc (empno varchar2(8), pay number(5), da number(5) , scale varchar2(11), effectdate date , flag varchar2(1)) with values as shown below.
    04485816      12800     4200     09300-34800      1-Jan-2006     Y
    04485816      13000     4200     09300-34800      1-Jul-2006     Y
    04485816      13450     4600     09300-34800      27-Sep-2006     Y
    04485816      13675     4600     09300-34800      1-Jul-2007     Y
    04485816      14200     4600     09300-34800      1-Jul-2008     Y
    04485816      14650     4600     09300-34800      1-Jul-2009     Y
    I just want to manipulate data into another table by using this data and i want the result as
    04485816 12800 4200 09300-34800 01-jan-2006
    04485816 12800 4200 09300-34800 01-feb-2006
    04485816      13000     4200 09300-34800 1-Jul-2006     
    04485816 13000 4200 09300-34800 1-aug-2006
    like data reproduced on every month and get changes in value based on the effect date.
    how to write pl sql program for this??
    I have tried some what like
    DECLARE
    EMP VARCHAR2(8);
    PAY NUMBER(5);
    GP NUMBER(5);
    SCALE VARCHAR2(11);
    INC date;
    PAD VARCHAR2(11);
    FL VARCHAR2(1);
    CURSOR A IS SELECT EMPNO,VIPAY,GRADEPAY,VISCALE,INCDATE,FLAG FROM CADREINC;
    BEGIN
    <<i_loop>> FOR I IN A LOOP
    INC:=I.INCDATE;
    FL:='Y';
    <<j_loop>> FOR K IN 1..12 LOOP
    INSERT INTO CADREFIX ( EMPNO,VIPAY,GRADEPAY,VISCALE,INCDATE) VALUES
    (I.EMPNO,I.VIPAY,I.GRADEPAY,I.VISCALE,I.INCDATE);
    I.incdate:=LAST_DAY(I.INCDATE)+1;
    EXIT j_loop WHEN pay>i.vipay and inc=i.incdate and fl='Y';
    --EXIT WHEN INC='01-JUL-2010'; 
    END LOOP;
    -- i.INCdate:=LAST_DAY(I.INCDATE)+1;
    EXIT i_loop WHEN pay>i.vipay and inc=i.incdate and fl='Y' ;
    END LOOP;
    COMMIT;
    END;
    but unable to get the desired results. The pay comes for every 12 months instead of upto effect date.
    Please help.

    Hi,
    Welcome to the forum!
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    If you're asking about a DML statement, such as INSERT, the CREATE TABLE and INSERT statements should re-create the tables as they are before the DML, and the results will be the contents of the changed table(s) when everything is finished.
    Always say which version of Oracle you're using.
    See the forum FAQ {message:id=9360002}
    Here's one way to do what you want in pure SQL. Since I don't have your table, I'll use scott.emp to show the way:
    WITH     data_by_month     AS
         SELECT       TRUNC (hiredate, 'MONTH')     AS hiremonth
         ,       COUNT (*)                  AS cnt
         FROM       scott.emp
         GROUP BY  TRUNC (hiredate, 'MONTH')
    ,     got_repeat_num     AS
         SELECT     hiremonth, cnt
         ,     MONTHS_BETWEEN ( LEAD (hiremonth) OVER (ORDER BY hiremonth)
                          , hiremonth
                          )     AS repeat_num
         FROM    data_by_month
    SELECT       ADD_MONTHS ( r.hiremonth
                     , c.column_value - 1
                   )                 AS report_month
    ,       cnt
    FROM          got_repeat_num  r
    CROSS JOIN     TABLE ( CAST ( MULTISET ( SELECT  LEVEL
                                                  FROM        dual
                               CONNECT BY     LEVEL     <= r.repeat_num
                         AS sys.odcinumberlist
                    )  c
    ORDER BY  report_month
    ;You can use a query like this in an INSERT or MERGE statement.
    If you need to use PL/SQL, then you can use an INSERT or MERGE statement, with a sub-query like the one show above, in PL/SQL.

  • How to control "To" Effective Date of Element Entry Screen in Assignment.

    hi,
    How do I Control the "To" Effective Date which is defaulted to 13th Apr 2007 in the Element Entry Screen of Assignment .When the screen is date tracked to
    01-APR-2007 and running payroll for the Month of April 2007.
    Navigation
    People--->Enter---->Assignment---->Element Entry
    Ram

    In addition to what Tim Mentioned it can also be depends on what date you attached this element to the employee
    you might have attached this element on 13th Apr 2007 to this particular assignment
    Regards
    Ramesh Kumar S

  • How to pull the job with the latest effective date in PSFT?

    Hello,
    I am running the PSFT 9.1.1 connector workforcefullsync.
    I ran into a problem when the user has multiple job records. Each time that the user job is updated, a new job record is created. So, when the data comes from PSFT, for a user, we have multiple jobs records with different effective date (For example <EFFDT IsChanged="Y">1996-10-21</EFFDT>). OIM is only interested in the latest EFFDT.
    Question 1: is it something that we can set on the PeopleSoft side, so that only the job with the highest EFFDT is sent to OIM?
    Question 1b: is this is not easy to accomplish from the PSFT side, can I use transformation in the connector to only pull the job record with the highest effective date?
    Question 2: if the EFFDT shows a date in the future (HR wants to disable a person in the future), does OIM ignore this change until the sysdate is after that EFFDT date?
    Thanks
    PS: workforcefullsync worked fine if the file contains only 1 job per employee. When the xml files contain multiple job records, I got the error:
    ERROR QuartzWorkerThread-1 OIMCP.PSFTER - oracle.iam.connectors.psft.common.handler.impl.PSFTWorkForceSyncReconMessageHandlerImpl : handleMessage
    ERROR QuartzWorkerThread-1 OIMCP.PSFTER - 1
    ERROR QuartzWorkerThread-1 OIMCP.PSFTER - Description : 1
    ERROR QuartzWorkerThread-1 OIMCP.PSFTER - java.lang.ArrayIndexOutOfBoundsException: 1
    Edited by: user12049102 on Mar 22, 2010 12:06 PM

    Hello,
    When the PSFT team sends a message over to OIM to disable a user with today's date, the user got disabled fine in OIM. A reconciliation event is created.
    When the PSFT team sends a message over to OIM to disable a user with a future date for EFFDT, let's say 3/31/2010, no reconciliation event was created.
    Does OIM store this information somewhere so that it will process it later on?
    It's a good thing that OIM does not disable the user who has an EFFDT in the future, but we don't want that record to be forgotten.
    Please help.
    Thanks

  • Selecting records from table A where A.date = max of date from table B

    Hi,
    I am new to OBIEE, How can I build the following Oracle query in OBIEE....
    select a.F1, a.F2, a.F3, a.date
    from Table1 a
    where a.date in
    (select max(b.date) from Table2 b where
    b.F1 = a.F1
    GROUP BY by b.F1)
    I tried Rank, Top, Aggregate however did not get the desired result.
    Thanks, Rohit

    You can create another request and use the results of that request as a Subquery in the filtering of the master request.

Maybe you are looking for

  • Indesign CS3 won't open

    My Indesign CS3 suddenly started giving me problems when I tried to open it. I have used it for a year or so with no problem. Now, when I click to open the program, I get the moving donut (on Vista) that indicates processing is taking place, but afte

  • Business Objects, Value Objects and more

    Hey, I've got a general question about business objects (aka entity objects or data transfer objects). The scenario I am using is not one of my own, but it might be a future one. Thus, I'd really appreciate all feedback. Let's say that i've got a des

  • MIRO - Copy Code from PO during Invoice posting

    Hi, I need to copy Company code from PO ie line item to the header in MIRO transaction during saving. I saw all the enhancements and BADI and feel I cannot change company code at header. Can any one tell me if I am correct or if it can done? How ?. t

  • Whats the best router for multiple Wireless-G

    I just want to know whats the best router for running multiple wireless-G with some things wired and some wireless also sharing on the network and gaming with a good internet connection whats the best router ? Good Speeds Good Range Multiple online s

  • SAP IS OIL MM Module Business Process Documents

    Hi all, I am new to IS oil, can anyone have Business process for MM module in  IS Oil. Thanks, Kamlesh.