Can you pls correct this query :: ( In Oracle Core HRMS )

Dear all,
i have created query get result :: ( In Oracle Core HRMS )
•     EE Number
•     Forename
•     Surname
•     Dept
•     Start Date
•     Leave Date
•     Date of Birth
•     Address
•     Salary (New & Existing Employee)
•     Car Allowance
•     Effective date (changes/updates)
•     Creation Date/Update date
•     Email address
•     Gender
•     Job Description
•     Grade
•     From and to date for parametres
•     Last Modified Date
SELECT
papf.EMPLOYEE_NUMBER emp_no
, papf.FIRST_NAME forname
, papf.LAST_NAME surname
, replace(replace(hou.attribute1,'10-',''), '14-', '') department
, pps.date_start strt_date
, pps.actual_termination_date leave_date
, papf.DATE_OF_BIRTH dob
, pdd.ADDRESS_LINE1||''||pdd.ADDRESS_LINE2||','||pdd.ADDRESS_LINE3 Address
, ppp.proposed_salary_n salary
, papf.EFFECTIVE_START_DATE estart_date
, papf.EFFECTIVE_END_DATE eend_date
, papf.CREATION_DATE crt_date
, papf.EMAIL_ADDRESS mail_addrs
, papf.SEX GENDER
, pj.NAME Job_Des
, substr(pg.name, 1, 1) GRADE
, papf.LAST_UPDATE_DATE Last_Modified_Date
FROM per_all_people_f papf
, per_all_assignments_f paaf
, per_addresses pdd
, per_pay_proposals ppp
, per_grades pg
, pay_payrolls_f pp
, per_jobs pj
, per_periods_of_service pps
, per_person_types ppt
, per_person_type_usages_f pptu
-- , pay_element_entries_f pee
, hr_organization_units hou
WHERE papf.person_id = paaf.person_id
AND papf.person_id = pdd.person_id
AND papf.person_id = pptu.person_id
and papf.person_id = pps.person_id
and pps.period_of_service_id = paaf.period_of_service_id
AND ppp.assignment_id = paaf.assignment_id
-- AND pee.assignment_id = paaf.assignment_id
AND paaf.grade_id = pg.grade_id
AND paaf.payroll_id = pp.payroll_id
AND pptu.person_type_id = ppt.person_type_id
AND paaf.organization_id = hou.organization_id
AND pj.job_id = paaf.job_id
AND ppp.pay_proposal_id = (SELECT MAX (pay_proposal_id)
FROM per_pay_proposals
WHERE assignment_id = paaf.assignment_id)
AND pp.payroll_id = 224
AND pdd.primary_flag = 'Y'
AND pee.element_type_id = 221 for car allowance
AND papf.employee_number <> 'NONE'
AND ppt.user_person_type in ('Employee', 'Ex-employee' ,'Intern')
AND ppt.system_person_type in ('EX_EMP', 'EMP')
AND TRUNC(SYSDATE) between papf.effective_start_date and papf.effective_end_date
AND TRUNC(SYSDATE) between paaf.effective_start_date and paaf.effective_end_date
AND TRUNC(SYSDATE) between pptu.effective_start_date and pptu.effective_end_date ;
can you pls correct this
still i need to add Car Allowance and Bank details in above query pls tell me where i can get dept details in oracle core HR
Thanks all
Edited by: 981527 on Jan 30, 2013 3:41 AM
Edited by: 981527 on Jan 31, 2013 1:22 AM
Edited by: 981527 on Jan 31, 2013 1:30 AM
Edited by: 981527 on Jan 31, 2013 9:03 PM
Edited by: 981527 on Feb 1, 2013 4:50 AM

I am taking a guess that 'Dept' is where the employee works, so that will be the column 'NAME' in the table HR_ALL_ORGANIZATION_UNITS; you will need to join with this table on the assignment's organization_id value
Edited to add: Whilst you're testing this, you might want to consider removing the table PAY_ELEMENT_ENTRIES_F from the table list, otherwise you can look forward to potentially large cartesian product of returned rows!
Clive
Edited by: clive_t on 31-Jan-2013 09:59

Similar Messages

  • What  are the advantages over sql in pl/sql...can you please answer this?

    Hi,
    what are the main differences between sql and pl/sql...why v are using pl/sql rather then sql...can you please answer this question?

    SQL is used to access the database. PL/SQL is a programming language where SQL is seamlessly integrated. In order to access the database in PL/SQL, you have to use SQL.
    Think of it as two pieces of software, two "engines". If you want to interact with the database, then performance wise it's best to use only one engine (SQL only), instead of two (PL/SQL and SQL). If a PL/SQL program executes a SQL statement, it does a "context switch", i.e. saving its state in PL/SQL before giving control to the SQL engine and vice versa. This is quite fast, but do a lot of them and it is slow, so beware of programming SQL statements inside loops.
    Another way to put it: SQL is a fourth generation language (4GL) where you tell what you want, not how. The software, the optimizer, will decide for you how to process the statement. PL/SQL is a third generation language (3GL), or at least the PL-part is, where you describe how things should be processed. Leading to more code and more control. With every Oracle release, SQL becomes more powerful and the optimizer gets better, so using SQL is increasingly important.
    For complex processing, using PL/SQL is still necessary. But use it with care.
    Hope this helps.
    Regards,
    Rob.

  • Can i use case in query in oracle form 6i

    sir can i use case in query in oracle form 6i
    such as
    select empno, case when deptno=10 then dptno end from emp;
    please gice me

    Hello,
    Does this code compile ?
    If not, I'm afraid that the PL/SQL engine of Forms6i does not recognize this syntax.
    Francois

  • HT4489 I am not able to transfer my in spite of VCf format from my computer to my iPhone 5S...can you pls suggest some way to do it as fast as possible

    Can you pls solve my issue......I am not able to transfer my in spite of VCf format from my computer to my iPhone 5S...can you pls suggest some way to do it as fast as possible

    What happens when you follow this?
    http://support.apple.com/kb/PH3605

  • HT201364 I keep getting the message "The product distribution file could not be verified. It may be damaged or was not signed." Does anyone know what I can do to correct this so I can download OSX?

    I keep getting the message "The product distribution file could not be verified. It may be damaged or was not signed." Does anyone know what I can do to correct this so I can download OSX?
    I have a MacBook Pro with all the necessary requirements.

    Here are a few things to try:
    Restart your Modem and Router.
    Reset iTunes Store Cache (iTunes Preferences, Advanced tabl)
    Delete the App Store plists (close App Store first):
    ~/Library/Preferences/com.apple.appstore.plist
    ~/Library/Preferences/com.apple.storeagent.plist
    To get to these,iIf you still have your user Library hidden, hold down the Option key and select Library from the Go menu in Finder. Otherwise, just go into your home folder, then Library, and then Preferences.

  • Can you pls tell me how to unfreeze my iMac?

    Can you pls tell me how to unfreeze my iMac?

    Hold down the power button until the iMac turns off. Then press the power button again to turn it back on. Does it then work correctly?

  • Can you pls send me the link to down load JDeveloper version 10.1.2

    Dear All,
    can you pls send me the link to down load JDeveloper version 10.1.2
    Regards,
    Prasanth.

    Hi,
    [http://www.oracle.com/technology/software/products/jdev/archives.html|http://www.oracle.com/technology/software/products/jdev/archives.html]
    Pedja

  • How do I correct this query ?

    here is a query:
    select roleid from Apps_USERROLE where guid in (select guid from Apps_USER_MASTER order by userid)
    This does not work ...because the internal subquery retruns multiple result.
    How do I correct this query ?

    Satish Kandi wrote:
    select roleid from Apps_USERROLE where guid in (select guid from Apps_USER_MASTER order by userid)ORDER BY clause is not supported in subqueries since it makes no sense.
    If you want an ordered result set, you need add order by clause to the main query.
    select roleid from Apps_USERROLE where guid in (select guid from Apps_USER_MASTER)
    order by roleid;
    HTH...we have a problem then . Apps_USER_MASTER has userid as primary key .
    select guid from Apps_USER_MASTER => this could give duplicate guid then .

  • My scroll feature of the Lenovo ThinkPad(red scroll) is not working in the new Firefox 4. It was working fine in 3.6. Can you please fix this as this is very important feature.

    The scroll feature(middle button) is not working on the new firefox 4. So because of this I need to move the scroll bar to move the page. This is very irritating problem, if you are a guy who uses the middle button to scroll. Can you please fix this..
    Thanks!!!

    I updated to Firefox 4.01 today and the middle scroll button on my Lenovo T400 stopped working. I downloaded the updated Ultranav utility and the Ultranav driver for my T400 from here http://www-307.ibm.com/pc/support/site.wss/MIGR-72858.html and then uninstalled the "Thinkpad Ultranav Driver" from Add/Remove programs rebooted and then installed the updated utility and driver (another reboot) and it now works perfectly.
    So glad to get this working again.

  • I cannot download updates to Photoshop Elements 9.  I get an error message that my serial number is not recognized or eligible.  Can you help with this?

    I cannot download updates to Photoshop Elements 9.  I get an error message that my serial number is not recognized or eligible.  Can you help with this?

    Hi,
    Which operating system are you running on?
    What updates are you trying to download?
    The last update was 9.0.3 - check by loading the editor and going to Help -> About Photoshop Elements
    The last supported Camera raw is ACR 6.5 - check by loading the editor and going to Help -> About Plug-ins -> Camera Raw
    Do you have a reason to update?
    Brian

  • TS4036 My iPhone5 was replaced today and when I did a restore I was only able to access a previous backup to the backup that I did yesterday? Hence, I do not have access to some apps such as ebooks and games. Can you help resolve this issue?

    My iPhone5 was replaced today and when I did a restore I was only able to access a previous backup to the backup that I did yesterday? Hence, I do not have access to some apps such as ebooks and games. Can you help resolve this issue?

    My girlfriend had a similar issue because her new device was not updated to IOS7 when she turned it on, but her backup point was created using IOS7.  Check to be sure the restore point was created and then factory reset the phone after you have updated to 7. 

  • HT204406 I have received an error message when i try to start iTunes Match, "We coulnd not complete your iTunes Store request.  An unknown error occurred (4001).  Can you help with this error?

    I subscribed to iTunes Match, but after the information is gathered about my iTunes library, i get an error message :  "We could not complete your iTunes Store request.  An unknown error occurred (4001).  Try again later." 
    Can you help fix this error?

    Yesterday I went to settings in my iPhone, Music, turned iTunes Match to "Off".  I then updated Match in iTunes and it worked!  I don't know why, but it worked.

  • To run VPN setup my iphone is requesting for 4 digit pass code ... can you pls assisit?

    To run VPN setup my iphone is requesting for 4 digit pass code ... can you pls assisit?

    Hello RozR,
    We've an article that can help circumvent the new passcode and restore access to your iPhone.
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/HT1212
    Cheers,
    Allen

  • I have no way to return to previous page without going completely out of firefox - can you help with this?

    I start with the home page of a site. Then go to one of the other pages on the same site. I find no way to return to the home page without going completely out of firefox and having to start all over again. In other words the "back" arrow is gray and does not work to get me back to the original home page. Can you help with this?

    Try double clicking on the Back arrow. If you click on it and hold it pressed, it should give you a drop down list of the previous pages. You can also achieve that by right click on the Back arrow. But if you do a single, quick click on it, it should take you back.

  • Can you give me a query to find a latch?

    Hi
    Can you give me a query to find a latch? If you have a script then please give it to me to find a latch.
    Thanks.
    Regards,
    RJ.

    There is no magic command to stop the latch, unless you shuting down your database.
    I would advise you to take several statspack snapshots, make reports, and analyze if latches are a problem.
    Then, in regards of which latches are in the top of lists of wait events, make what required, not before.
    Nicolas.

Maybe you are looking for

  • Use iMac as monitor for PC?

    Is it possible to use my iMac as a monitor for a PC? Also, if I had a Razer BlackWidow Ultimate 2014 MAC Elite Mechanical Gaming Keyboard...and I was able to use my iMac as a PC monitor...would the keyboard work when I am operating my the PC? Thanks!

  • Duties are not posted in RG23A

    Dear all , We have made GRN but Duties are not posted in RG23A . What may be the Possible reasons pl guide

  • Extract Photos from iPhoto Slideshow DVD

    I made a DVD via iPhoto for someone for the purpose of viewing pictures without actually having possession them, and I heard they found a way to get the pictures off. Is this true, or was the iPhoto slideshow made incorrectly? Thanks, DiFFeReN7

  • WCS 7.0 AP Audit Report

    I have moved some APs from one controller to another.  I notice now that the AP audit reports shows a mismatch between WCS and the WLC.  The attribute that is being reported is Support Encryption and Max Clients.  The Max Clients is an RRM threashold

  • FLV and Navigation issue

    I have a lot of videos in the stage, and some of them that are loaded within a swf, so the problem is, when i press any button of the menu or something to navigate across the interface, the video it does not stop playing, it get stuck in the backgrou