How to check the leap year among the years of earning a new degree?

Hi All,
I've developed a report to print a report of emplyees who earn a new degree between tow dates entered by two user parameters.
I've used this code to do that:
SELECT ALL E.EMP_SID, E.EMP_FULL_NAME, E.FINANCIAL_NO
(CASE WHEN E.qualification_sid = 1104 AND E.degree_sid = 8 THEN
(TO_DATE(E.degree_DATE, 'DD-MM-RR')+(365*M.spe_per)+1)
ELSE
(TO_DATE(E.degree_DATE, 'DD-MM-RR')+(365*M.yea_per)+1)
END)
COMM_degree,
FROM EMPLOYEESS E, DEGREES M
WHERE (CASE WHEN E.qualification_sid = 1104 AND E.degree_sid = 8 THEN
(TO_DATE(E.degree_DATE, 'DD-MM-RR')+(365*M.spe_per)+1)
ELSE
(TO_DATE(E.degree_DATE, 'DD-MM-RR')+(365*M.yea_per)+1)
END)
BETWEEN TO_DATE(:P_F_DATE, 'DD-MM-RR') AND TO_DATE(:P_L_DATE, 'DD-MM-RR')
AND (E.degree_SID = M.SID)
ORDER BY M.SID DESC, E.EMP_FULL_NAME
Now there is a mistake in the data resulted for some employees who have leap yaers in thier earning yaers
for example: an employee has a degree date of 01/10/2011 and the supposed earn of next degree is 01/10/2016 but the report gives it as 30/09/2016 because there is a leap year 2012 which has 366 days not 365 days as I count in the code!
If there is any mysterious thing in the code please don't hesitate to ask about it!
Plz how to solve this problem?
Note: I'm using Reports 6i.

HI
tRY ADD_MONTHS(SYSDATE,12) - IN PLACE OF 365 DAYS
IF ANY PROBLEM LET US KNOW

Similar Messages

  • How to check my job name from the database...

    I have written one job scheduler which is as follows :
    SQL> ED
    Wrote file afiedt.buf
    1 DECLARE
    2 X NUMBER;
    3 JobNumber NUMBER;
    4 BEGIN
    5 SYS.DBMS_JOB.SUBMIT
    6 (
    7 job => X
    8 ,what => 'scott.SPLITSMS;'
    9 ,next_date => SYSDATE+1/1440
    10 ,interval => 'SYSDATE+1/1440 '
    11 ,no_parse => FALSE
    12 );
    13 JobNumber := to_char(X);
    14* END;
    15 /
    PL/SQL procedure successfully completed.
    Now I want to check whether the job has been really created or not?
    so for that I have used the following command line:
    SQL> SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS';
    SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS'
    ERROR at line 1:
    ORA-00942: table or view does not exist
    how to check my job name from the database...
    what is the command used to check the job_name ????
    and how can i ensure that my job scheduler is running properly...???
    please help ........my dear friends.....!

    957029 wrote:
    Now I want to check whether the job has been really created or not?
    so for that I have used the following command line:
    SQL> SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS';
    SELECT JOB_NAME FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = 'SCOTT.SPLITSMS'
    ERROR at line 1:
    ORA-00942: table or view does not existYou can use DBA_* views only if the User has been Granted a DBA Privilege.
    how to check my job name from the database...
    what is the command used to check the job_name ????You can use USER_JOBS view to check. But, is it not that you have just created the Job, so you must be knowing it?
    and how can i ensure that my job scheduler is running properly...???If USER_JOBS.FAILURES is Non Zero, that means the Job has encountered a problem that needs to be Investigated. Similarly, the LAST_DATE, LAST_SEC, NEXT_DAY, NEXT_SEC can be used to determine if the Job has been running successfully.
    if you are on 11g, you should consider using DBMS_SCHEDULER.

  • How I check in group by query the group change

    How I check in group by query the group change
    Hi master
    Sir I have master detail table
    This is my query
    select rownum,chartofacc.accid,title,nvl(drbal,0),nvl(crbal,0),
    (select case when nvl(sum(debit),0)-nvl(sum(credit),0)>0 then
    nvl(sum(debit),0)-nvl(sum(credit),0)
    else
    0
    end mfadrttt
    from voudetail where voudetail.accid=chartofacc.accid) as mfadr,
    (select case when nvl(sum(credit),0)-nvl(sum(debit),0)>0 then
    nvl(sum(credit),0)-nvl(sum(debit),0)
    else
    0
    end mfacrttt
    from voudetail where voudetail.accid=chartofacc.accid) as mfacr
    ,nvl(debit,0),nvl(credit,0),voumaster.entdate,voumaster.vno from chartofacc ,accbal,voudetail,voumaster where chartofacc.accid=accbal.accid(+) and chartofacc.accid=voudetail.accid(+) and voumaster.vno=voudetail.vno order by chartofacc.accid,voumaster.entdate,voudetail.VNO;
    Sir I need add opbal from master section to debit in detail section when new group start only after adding I use that column for accumulative total or running balance
    If I get any method when group change system give me any key or indication then I use
    Please give me idea in both field oracle sql and oracle report 6i
    Thank
    aamir

    Hi,
    Please send tables structures and sample data from that tables. And, of course what should be the output. :) Just sending your query won't help us to find a solution.
    Peter D.

  • How to check whether current time satisfies the schedule?

    I am working on a task, which is opposite of cron tab. My application is in groovy but can call all Java api. Can you please provide some pointers?
    User is allowed to schedule a rule to be executed the way crontab gives the options. For example he wants the rule to be executed from Monday to Friday from 8 am to 5 pm.
    I can’s schedule in crontabe or Quartz. At run time I have to match, whether the current time satisfy the time condition entered by user.
    I may have to store this information in the database the way we put in the cron. Eg. my tables will have following
    Id|| Policy Id|| seconds|| minutes|| hours|| Day|| Date|| month|| year
    1 || 5 || 1     || 1 || 8-17 || M-F||? || * ||*
    Now while my code is getting executing, how can I match whether the current time matches the condition mentioned above.
    Thanks in advance.

    [Using Span|http://tus.svn.sourceforge.net/viewvc/tus/tjacobs/util/] would make this easy

  • How to check for missing fields in the file?

    Hi friends,
    I have a file to file scenario in which if any of the fields have a blank value, i have to put the file back in the source folder. If none of the fields are missing, the scenario should work normally.
    Can anybody tell me <b>how can i check for the field lengths</b> and if any of the fields are blank, <b>how do i send it back to the original folder.</b>
    Waiting for your responses,
    Divija.

    Hi Divija,
    >><i>how can i check for the field lengths</i>
    Since you need to basically check if the field has a value or not, i dnt think you need to check for the length of the field. Instead, you can use any one of the booloean functions available in the graphical mapping editor to check if the field has a value or not(filed value true or false)
    >><i>how do i send it back to the original folder.</i>
    You can maintain a flag variable in the target structure such that if any of the source fields donot have values, the flag's value becomes 1 else it remains 0.
    Now, you can check if the value of flag is equal to 1/0 in the bpm and accordingly send the data.
    If in case, you donot want the flag to come in the target file that is loaded/sent from the bpm in the end, i think even tat can be taklen care of.
    You can create two receiver communication channels and define one file adapter in each such that one has the destination as the actual target directory and the other has the original source directory as the destination.
    Regards,
    Sushumna

  • How to check wwheter two files are the same?

    Hi,
    I need to check wheter two files are the same. Their names and paths may be different. How to do that? Do u have any links / examples?
    Important notice: Files used in the application will be big (ie 1, 2gb)

    Comparing a hash, if you have to calculate it each
    time, is bound to be slower than a byte by byte, or
    character by character compare.
    This kind of comparison is used mostly in things like
    content management systems, when a new file of data
    is checked to see if it's identical to a file already
    entered, hash values being stored for each file
    already in the system.
    And comparing the hashes can only prove the files are
    different, if the hashes are equal that doesn't
    absolutely guarantee that the files are the same.
    Normally you'd confirm a matching hash by actually
    comparing file content.Depends on how good your hash is..but in general...yes. I was only saying that it's faster if you're always maintaining a has of the file.

  • How to check for latest Apps in the App Store

    Is there a way to check for the latest apps. I only see options to sort by name and by best-sellers. If there is no way how can i request this feature. Thanks.

    As I understand the Mac App Store, that sort is already done for you in Features. The first category on the Features page is New and Noteworthy, with the link to See All.
    Dah•veed

  • How to check and change quality of the photos taken

    Hello,
    Would you please suggest where I can change the quality of the photos taken by my Sony Xperia Z3 Compact?

    Hi Pollyjourn,
    Welcome to the community! Since you're new please be sure that you have checked out our Discussion guidelines.
    You can also try looking through he user guide for the device. I have supplied a link for the online user guide and the PDF version of the user guide.
    Online user Guide
    http://support.sonymobile.com/global-en/xperiaz3compact/userguide/General-camera-settings/
    PDF version
    http://www-support-downloads.sonymobile.com/d5803/userguide_EN_D5803-D5833_1_Android4.4.pdf
    I hope this helps.
     - Official Sony Xperia Support Staff
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • How to check total INBOX size of the user mailboxes

    Hi All,
    I issued the following command and the output as shown:
    /opt/SUNWmsgsr/sbin/mboxutil -l -p "user/*@a.com/INBOX"
    msgs Kbytes last msg partition quotaroot mailbox
    121 10731 2008/08/31 12:24 primary 51200 user/[email protected]/INBOX
    0 0 2008/09/01 09:57 primary 51200 user/[email protected]/INBOX
    88 17276 2008/08/31 12:24 primary 51200 user/[email protected]/INBOX
    2 561 2008/09/01 18:38 primary 51200 user/[email protected]/INBOX
    10 587 2008/09/01 14:30 primary 51200 user/[email protected]/INBOX
    0 0 2008/09/01 14:38 primary 51200 user/[email protected]/INBOX
    42 16649 2008/08/31 10:01 primary 51200 user/[email protected]/INBOX
    109 31564 2008/08/31 20:43 primary 51200 user/[email protected]/INBOX
    59 28990 2008/08/31 10:01 primary 51200 user/[email protected]/INBOX
    I would like to know total size of INBOX of a.com domain. Please help if you have idea.
    Following is my message server version:
    Sun Java(tm) System Messaging Server 6.2-7.05 (built Sep 5 2006)
    libimta.so 6.2-7.05 (built 12:18:44, Sep 5 2006)

    Yap wrote:
    I would like to know total size of INBOX of a.com domain. Please help if you have idea.You can use the awk command to sum up the individual sizes e.g.
    /opt/SUNWmsgsr/sbin/mboxutil -l -p "user/*@a.com/INBOX" | awk '{ sum += $2; } END { print "Total Size (Kb): " sum; }'Regards,
    Shane.

  • How to check which administrator had modified the AD Group properties

    Dear Sir,
    Some one had modified a Distribution group (removed email address). I checked it in group properties and last modified was on 22/09/14. How to find which administrator had modified.
    I dont have access to domain controller. Is there any way to find it?
    thanks in advance.
    Karan

    Hello,
    this will be logged on DCs and also auditing must be configured correct that this will show up in the event viewer from a DC.
    Without access to the DC contact your administrators and let them find out.
    Best regards
    Meinolf Weber
    MVP, MCP, MCTS
    Microsoft MVP - Directory Services
    My Blog: http://blogs.msmvps.com/MWeber
    Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
    Twitter:  

  • How to check if a field in the table is same in all rows??

    Hi Folks,
    Is there a feature in abap where we can check if a field in a table is same in all rows.
    Thanks,
    Matt

    This can be easily self-programmed
    read itab index 1.  "get first row
    "now check if exeists any entry with different value
    read itab with key field1 ne itab-field1 transporting no fields.
    if sy-subrc = 0.
      "not all rows have the same value
    else.
      "all rows have the same value
    endif.
    Regards
    Marcin
    Right now I noticed that using NE operator is not allowed in READ TABLE statement, but you can do simple loop instead
    read itab index 1 into l_field1.  "get first row
    loop at itab where field1 ne l_field1.
       flag = 'X'.
       exit.
    endloop.
    if flag = 'X'.
      write: 'some fields are not equal'.
    endif.
    Edited by: Marcin Pciak on Oct 6, 2009 5:35 PM

  • Which package is the most imortant among the peoplesoft packages?

    I want to be a PeopleSoft programmer, I understand SQR(I used to use it in Hyperion system), and I want to install a peoplesoft software in my laptop, what is the basic software I should install first? Since there are too many peoplesoft packages, I'm not sure which one is the most important and basic staff I should learn first? Is it PeopleSoft Enterprise Perfromance Management? Please advise, thanks!

    You should install the database platform and then install the PeopleTools system database. Then install the PeopleTools local client to get access to App Designer.
    As a starting point you should just learn the toolset and not worry about the specific applications. All of the modules are built using the toolset. You will need to setup a PIA environment before learning App Engine again this can occur without any specific modules.
    Once you know the toolset it depends on the modules you want to learn. Project Costing is a core module that is a good one to know as it is used by most applications.

  • How you check what you get in your package is there a new you text ?

    Just moved to a new package and just wondering how do I check it through text to see what I get for it

    Text PLAN to 150. Text AL to 150.

  • How to find the maximum value among four fields in a single record

    Hi Gems...
    I have a record in which there are 4 currency fields.
    Now i would like to know the maximum of these 4 fields.
    I tried with Max functions in which i put all the 4 values...but it is showing error like ") is missing" though it is there.
    Can we insert more than 2 values in Max function?
    Or else is there any other option to find the max value among the 4 values which lies in a single record
    Thanks
    Jiten

    Hi Anil,
    Say suppose i have a single record in which 4 premiums of a particular bond exists.
    for eg:
    Prem1      Prem2        Prem3          Prem4
    129000.00      388000.00   228000.00   14800.00
    Now this is a single record for a particular bond ... now i need to calculate the max value among these 4 premiums.
    How would we proceed to achieve this?
    Regards
    Jiten
    Edited by: Jitendra Yuddandi on Feb 3, 2009 1:04 PM

  • How to get the max value in the query??

    Plant  calday(mm.dd.yyyy)       Soldout.Qty
    0001   01.01.2005               10
    0001   01.02.2005               20
    0001   01.03.2005               05
    0001   01.04.2005               16
    0001   01.05.2005               10
    0001   01.06.2005               14
        From the above values , how can i findout Max(Soldout.Qty)(i.e 20) for the above week...Suppose present aggregation = summation...How can i findout the value in the Query??don't want to do changes to design...

    Hi Bhanu,
      I tried the calculation results as...Maximum,..
      But that will pick the maximum value among the avialable values..like
    plant1 max 10
    plant2 max 20
    plant3 max 30
    then it will show as..
    plant1 max 30
    plant2 max 30
    ...like this...but my case is
    plant1 calday1 10
    plant1 calday2 05
    plan1  calday7 08
    plant2 calday1 10
    plant2 calday2 05
    plan2  calday7 20
    so for each set it need to bring the maximum value...

Maybe you are looking for

  • How to modify a variant

    How to modify the variant for a batch job, which is to include 2 countries for a job. Please let me know the tcode.

  • Alerts--Subscribe to an Alert---??

    Hi, I am trying to configure alerts.  (weblog--/people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated). I have created an alertcategory, assigned the users to it and saved it. When i went into RWB--> Aler

  • What is the best way to create illustrator files for frames created in an InDesign layout?

    Is there a quick way to do that or do i need to note the size of each frame in InDesgin and then input that into the dialog in illustrator. It seems like a waste of time. Is there a better way? I am new to InDesgin. What I'd like is a way to automati

  • Problems with applying patches

    After installing the Oracle 8.1.5 software on a Redhat 6.1 server I try to apply the patches I downloaded from technet. After I applied these patches, nothing seems to work. The lsnrctl is missing, Oracle has changed to Oracle0, and when I start the

  • MI 7.1 data objects push data to backend in some sequence

    Hi all, Let's say we have 2 data objects with no dependency between these. If we add instances of these data objects on the client in some sequence, can we be sure that these instances will arrive on DOE in the same order and will be processed in tha