Need age in years based on his/her next birth day.

Hi,
I need to Print age in years based on his/her next birth day.
SELECT TO_CHAR(TRUNC(MONTHS_BETWEEN((SYSDATE ), P.birth_date)/12)) A from employee I used the above code but I get the age with reference to the sysdate only. But what I require is the age based on next birthday.
For ex: Birth day: 24FEB2000
Then my expected output is 10.
If my birthday would have been 24DEC2000, then I would expect a result of '9', please help me with a function or a simple sql statement to code this.
Thank You

Maybe something like:
SQL> SELECT sysdate FROM Dual
  2  /
SYSDATE
17-JUN-09
1 row selected.
SQL> WITH test_tab AS
  2       (SELECT TO_DATE ('24FEB2000', 'DDMONYYYY') birth_date
  3          FROM DUAL
  4        UNION ALL
  5        SELECT TO_DATE ('24JUL2000', 'DDMONYYYY') birth_date
  6          FROM DUAL
  7        UNION ALL
  8        SELECT TO_DATE ('17JUN2000', 'DDMONYYYY') birth_date
  9          FROM DUAL)
10  SELECT birth_date,
11         CASE
12            WHEN SIGN (  TO_DATE (   TO_CHAR (birth_date, 'DDMON')
13                                  || TO_CHAR (SYSDATE, 'YYYY'),
14                                  'DDMONYYYY'
15                                 )
16                       - TRUNC (SYSDATE)
17                      ) <> 0
18               THEN TRUNC (MONTHS_BETWEEN (TRUNC (SYSDATE), birth_date) / 12)
19                    + 1
20            ELSE TRUNC (MONTHS_BETWEEN ((SYSDATE), birth_date) / 12)
21         END age
22    FROM test_tab
23  /
BIRTH_DAT        AGE
24-FEB-00         10
24-JUL-00          9
17-JUN-00          9
3 rows selected.
SQL> Hmm... Sean's Query is better....
Regards,
Jo

Similar Messages

  • My iPod shuffle does not accept music, while his(her,its) fact one the years when his(her,its) good walking(step), when do I have to make

    My iPod shuffle does not accept music, while his(her,its) fact one the years when his(her,its) good walking(step), when do I have to make

    I couldn't understand your question? What is going on and what are you trying to do? Perhaps this article can help.
    Syncing music to iPod shuffle
    B-rock

  • To Calculate age in years

    Hi Experts,
                        I need to calculate the age in years. I have the date of birth already in my infoprovider that  iam using for my query.
    The user will be entering the date on which he want to calculate the age in the selection screen and the date will be stored in a variable..
    Now how to calculate the age in years and display it as a separate coloumn in the report?
    Regards,
    Khan

    Hi,
    Here 1st create the one formula variable on birth date
    then create one more formul variable customer exit varaible with user entry here u cna use the i_step = 2 there user enters which ever that date based on that date it executes
    in CKF: this  customer exit user entry varible - birth date formula varible
    whenever the user enters date based on that now u r getting  days of the employe AGe
    now that CKF can be used in another CKF  by using age/365
    now in report u can keep only second CKF.
    Thanks & Regards,
    Sathish

  • How to notify a self registered user that his/her request has been denied

    Hello,
    Is there a way to send an email to the requestor (this email address is what the user puts in the self registration form under requestor email) to notify that the request has been denied? (OIM 9.1)
    In The User Registration Process Definition, Task Awaiting Approval Data, I have the Assignment Tab set as follows:
    Rule: Default
    Target Type: Group
    Adapter AssignApproverGroup (this adapter dynamically looks for the members in a group based on the requestor organization, assigns the task to these individuals, and sends an email notifying that self registration approval is pending to all members of that approvergroup)
    Priority: 1
    Notification Tab
    Assignee is checked
    Status: R
    Email: Self registration request Denial
    When the Assignee logs in and denies the request, an email is sent to the Assignee about the denial.
    Questions:
    1. If the ApproverGroup has more than 1 member, how can we notify all the members of the Approver group that the request has been denied?
    2. How can we notify the requestor that his/her request has been denied using his/her provided email from the self registration form?
    Thanks
    Edited by: Khanh on Dec 4, 2008 3:36 PM

    You need to think about how the whole system is going to work - you need to know everything that the button will require, and then think about how to provide this information to the button.
    So, by the sounds of you need say a single button to press when you want to add a new button to the calculator. Associated with this have text fields that take the function for the calculator. I would specify that the function uses variables e.g. x and y as in function = x * y. Then your program could parse the input string describing the function, by recognising "*" to mean * in the Java code syntax and "/" to mean /. Then treat everything else as variables. Since you can filter out the other variables i.e. not the operators, you can then say associate an array to contain the values of these. Then when the user uses the button and specifies the input parameters and presses the button, you can update this array, and perform the calculation based upon these values.
    Hope this helps.
    My advice really is just to think about everything that a button that creates new function buttons is going to need.
    PS. Remember to repaint the GUI once update its Container. Swing does this automatically, but I always specify it explicitly anyway to be safe. You can use either repaint(), validate(), or revalidate().
    Goodluck mate!

  • First Day of Year based on given 12-month date

    Hi All,
    i want to get first day of the given year based on 12-month financial year.
    i'e if i entered '21-Sep-2014' as a given date then expected output is '01-Oct-2013'
    Could you please suggest best way to get this done.
    Thanks in advance.
    bala krishna

    Dan thanks for your reply.
    am adding more description below to my post:
    The thing is for a given date i needs to find out
    Year Start Date , Year
    End Date.
    For this am using below scripts respectively
    SELECT DATEADD(yy, DATEDIFF(yy, 0, GETDATE()), 0);
    SELECT DATEADD(DD, -1 ,DATEADD(yy, DATEDIFF(yy, 0, GETDATE()) + 1, 0));
    Here , the problem is , now its giving the current year first day and Last day.
    But what i want is Year first day should be based on (minus 12 month) i'e '01-OCT-2013'
    and Year End Day should be '30-SEP-2014'
    i hope now the requirement is more clear.
    bala krishna
    Try like this
    SELECT DATEADD(mm,DATEDIFF(mm,0,GETDATE())-11,0) AS StartDate,DATEADD(mm,DATEDIFF(mm,0,GETDATE())+1,-1) AS EndDate
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How can I create a text pop up window in my Pages document? I want text to pop up when the reader hovers his/her cursor over a certain word.

    How can I create a text pop up window in my Pages document? I want text to pop up when the reader hovers his/her cursor over a certain word in the document. I am teacher. So for example when a student came to word he/she did not know, if he/she hovered the cursor over the word, a defintion or other information would appear.  You can do this in Word using bookmarks/hyperlinks but I can't figure this out in Pages. I can link it to another point in my Pages document but I just need the text to pop up - not take the reader to another location.  THANK YOU!!!!!!

    Have you tried Word for Mac?
    You will need to test if links survive export or printing to .pdf
    Peter

  • How to get forgatted new/old password through typing his/her emial address

    we are on 11.5.10,
    I would like to know any feature availabe in oracle erp, which help user to type emial & then new password automatically to be sent there emial address.

    user-Keen wrote:
    But i am looking a way to be sent a password at employee emial address if they click on forget option by typing his/her emial address.
    thanks.Use the "Forgot Password" feature.
    Please see old threads for the docs you need to refer to -- https://forums.oracle.com/forums/search.jspa?threadID=&q=Forgot+AND+Password&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • User wants to get the cumulative values based on his input.

    Hi
    I am working one FI Report; the out put values are Cumulative values for Current, Previous years. I developed and it fetches the data last 3 years Cumulative year’s data without any input FYMonth based on SAPexits and varible offsets. But user wants to put Fiscal year Month as input. So he wants get the cumulative values based on his input. For example, If his input SEP'2005(062005), Then Query gives the Output Cumulative Value (I.e., Sum of Total values of Form APR'2005 to SEP'2005)
    Please provide the solution…
    Thanks
    Mannev

    Mannev,
    You can try doing this.
    1. If the user input is fiscal period(2005006) , you can create a customer exit variable which will take the user value (i_step =2), and change the variable value to 20005001. (this is a simple code where tye last 2 digits are replaced by 01).
    if the user is entering calmonth, you can use FM - DATE_TO_PERIOD_CONVERT, to convert the month to fiscal period.
    2. You can create a rkf with restrictions on time char based on the customer exit variable and the user entered variable.
    -Saket

  • Why contacts birthdays are being showed in iCloud calendar all with the same age (11 years)??

    Why contacts birthdays are being showed in iCloud calender all with the same age (11 years) ?? There is a solution to solve this problem ??
    Thank-you

    I cannot agree more with your comments! What a way to frustrate your customers!
    I have been having an issue with iCloud on Mac where it kept asking me for my password and sometimes would, sometimes would not continue to access my iCloud mail. Today it just refused to connect to iCloud mail.
    I looked in the Mail, Contacts and Calendars in my MacBook Pro settings and discovered that 2 iCloud accounts were present. One with my original Apple ID (a gmail address) and a second with my new iCloud email ( an @me.com address). Having deleted the second account, using the new @me.com address everything is working fine.
    So from my viewpoint when I moved over to iCloud I was asked to sign in with my Apple ID (the gmail address) then to create an @me.com address. However, as far as I can see all sign ins to the new @me.com account on Macbook, iPhone and iPad need to be done through the old Apple ID (the gmail address). Is that confusing and just plain crazy???
    Further, after creating the new @me.com address I soon found out that this is apparently now forever bound to my old Apple ID and cannot be changed. I mean why can't I delete the iCloud account and start anew with a different @me.com address??? Also, as everybody using iCloud must create an @me.com address why on earth can I not get rid of my old gmail address and have my entire Apple ID accessed through the new @me.com address? Creating a whole new Apple ID will not solve this as we are unable to transfer purchases between accounts.
    Apple products are great IMHO, but they do seem to not think things through in a very big way sometimes......

  • Cannot find  the age in years csv file  in  the application server

    Hi,
      I want to upload the age in years hierarchy from the CSV  file AGE_E.CSV that should be available in the application server.
      When i try to preview file in the info package, a message is thrown which says that the file does not exist, which means that the perticular file is not present in the application server.
      Can any one of you please tell me where else can i find this file.
    Regards,
    Chetana.

    dear Chetana,
    transaction AL11 can be used to check the file location.
    check DIR_TEMP or DIR_TRANS. or ask basis where the file is put.
    hope this helps.

  • Need to default dates based on appraisal model in Java Iview MboStatusApp

    Hi Gurus,
      I Need to default dates based on appraisal model selected in Java Iview MboStatusApp in MSS->Team->Performance Managemeent->Update Appraisals of reportees->Status overview .
    In this iview we have drop down with list of appraisal models along with the validity period(Start and end date)
    Trails Made : HRPDV00APPRAISAL0001 - I made an implementation for this BADI along with the iview settings at
    self services - > Use Evaluation Period for Employee Selection set to 'NO'.
    But when i tried to run the iview after implementation of BADI , i see there is no execution of BADI .
    My Basic requirement is when manager select any appraisal model say 2009 's appraisal model then dates must be as
    start date : 01/01/2009   End data : 12/31/2009
    when i select 2011 appraisal model
    start date : 01/01/2011   End data : 12/31/2011
    Please help !
    Appreciates the efforts made !!!

    Hi Reddy, did you get any solution on how to change the initial date in Status overview?
    Best regards
    Lasse Finderup

  • ISupport - register a person as a user associated with his/her Person Party

    Hi,
    iSupport 11.5.10.2
    I have a situation in my organisation where I would like to register an individual as an iSupport User associated with his / her Person Party Number.
    For example: John Doe has been set up in the system as a Person Party, and has an Account Number generated. He has certain Service Contracts and Install Base records associated with the Account Number. John Doe would like to register through the iSupport portal and be associated with the above Party / Account Number and be able to update his IB, check Orders and Invoices.
    Can this be done using any of the existing (seeded) Usertypes, Enrollments etc.?
    Thanks and Regards.

    This cannot be done in 11.5.10.
    But we have this feature in R12.

  • How do I set a user to access with ftp to his/her website folder ?

    I am new to MacOSX
    I come from Linux Server administrated with Virtualmin
    I was able to setup with SLP 10.6.8
    Now everything works but ftp ...
    I want to do this:
    1) web site domain1 = OK
    2) mail user@domain1 = OK
    3) mysql access user(domain1) = OK
    ---> 4) ftp user(domain1) = home web site domain1 = NOT OK ! <---
    How to tell server to let user(domain1) access throught ftp and jump into his/her home site folder ?
    This is necessary for me to grant access to his/her site home and upload, modify stuffs etc ...
    Also I am using cms like Drupal, Wordpress and so on that can upload and install upgrades via web admin panel and with MacOSX isn't working !
    Gimme some hints please Server Admin is too poor and I had to manually add user and link to relative services ... now i am stuck on ftp ...

    It is in the process of being disabled. It will likely be some time next week before the code will be reverted.

  • I bought 2nd hand iPhone and was linked with previous owner. I want to contact him but i didn't get any address of him. How can iget his/her email address using that iphone IMEI or you know any idea... Please reply if you know solution .....

    I bought 2nd hand iPhone and was linked with previous owner. I want to contact him but i didn't get any address of him. How can iget his/her email address using that iphone IMEI or you know any idea... Please reply if you know solution .....

    There is no solution here and you should already have known this as you replied to a thread all about this a few up from your own post and this stated the postition quite clearly and the question was answered.
    Why do you ask the same question again?  The first answer is not going to change just because you don't like it!!

  • My two year old smashed his ipad after throwing it down from the 11th floor. the is badly into pieces, thus i cant find the serial number. pls help

    Get appointment date with apple support and service provider. As my two year old samshed his ipad by through it down from the 11 th floor. whole screen is literaaly into pieces and unsafe to touch. this ipad was given by my sister to my son on his 2nd birthday, so dont know much about it. Pls help

    http://www.apple.com/retail/
    Enter your zip code, pick your store, and make an appointment.

Maybe you are looking for

  • Trying to install os 10.5.4

    I have a Power Mac G4 (quicksilver) I am trying to load either os 10.0.4 or 10.5.4 and the installation gets part way through and it says that the file could not be written while using the 10.0.4. I have tried with disks for both (grey one that came

  • Problems with Bluetooth after upgrading to Lion?

    I just upgraded to Lion and now when I plug my cinema display onto my MacBook bluetooth shows as unavailable. Sometimes it stops the trackpad working too. I took it into Regent Street Apple Store and the same thing happened there, they seem to think

  • Error while debugging AIR for IOS app

    I get the following error when attempting to debug my AIR-IOS app on an IPad 2. The weird thing is that the logfile mentioned does not exist. Any ideas? - Abey # A fatal error has been detected by the Java Runtime Environment: #  EXCEPTION_UNCAUGHT_C

  • Error 1 occurred at AB_Destination.lvclass:

    during the build (source distr) the folliwing pops up: Error 1 occurred at AB_Destination.lvclass:Copy_File.vi -> AB_Source.lvclass:etc etc... It first made a path and a file in build directory: C:\builds\Program Files\National Instruments\LabVIEW 8.

  • Opt. Runtime in  TPVS Optimization profile

    Dear All, We have small issue where we are unable to control the users. In TPVS Optimization Profile we have maintained certain Opt. Runtime for ex: 1500 sec i.e. 25 Min. What users are doing is while running the optimization they are changing the ru