How do i extract year from a variable???

Hi all,
I want to extract year from a parameter.
I tried the following, i'm getting errors.
When I executed the below code,
SELECT TO_CHAR(:X_PRM_YR_END_DT,'YYYY') FROM dual;
I got the following error.
ORA-01722:invalid number
When I executed the below code,
SELECT TO_DATE(:X_PRM_YR_END_DT,'YYYY') FROM dual;
SELECT to_char(TO_DATE(:X_PRM_YR_END_DT,'YYYY')) FROM dual;
I got the following error.
ORA-01830: date format end before converting entire input string
When I executed the below code,
  SELECT extract(YEAR FROM :X_PRM_YR_END_DT) FROM dual;
  SELECT extract(YEAR FROM 1/11/2013) FROM dual;
I got the following error.
ORA-30076: invalid extract field for extract source
How do i extract year from a variable???
Help me plz
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production.

Try This,
select TO_CHAR(to_date('01/01/1980','dd/mm/yyyy'),'YYYY') FROM dual;

Similar Messages

  • How do I extract email from a form and send the PDF to that user?

    How do I extract email from a form and send the PDF to that user?

    here you can add email to send to, CC, Subject, and body message
    var oDoc = event.target;
                        oDoc.mailDoc({
                                                                bUI: false,
                                                                cTo: "Agency Contact Email",
                                                                cCC: "",
                                                                cSubject: "Write your title here,
                                                                cMsg: "Dear" + AgencyContact + "(" + AgencyContactEmail + ")\nThe student, " + FirstName + " " + LastName + " has applied to work at your agency. Please confirm they can work here blah blah blah.......\n\nThanks.\n\nrespectuflly,\n\nme"

  • How do i extract pages from within a pdf document?

    how do i extract pages from within a pdf document?

    Hi adobespurs,
    To extract pages from a PDF, you need to use Acrobat. If you don't have Acrobat, you can try it for free for 30 days. Please see www.adobe.com/products/acrobat.html for more information.
    Best,
    Sara

  • How do I extract pages from a Secured PDF file

    How do I extract pages from a Secured PDF file?

    Adobe would call that hacking, and don't allow discussion of it in this forum. You should contact the copyright holder and see if they are prepared to release the password, or an unsecured document, to you. If it's something made for you like a bank statement you should tell the bank how inconvenient their choices are.

  • Just had Adobe Reader 11 installed on my Mac desktop.  How do I extract pages from a PDF?

    Just had Adobe Reader 11 installed on my Mac desktop.  How do I extract pages from a PDF?

    You can extract pages with Adobe Acrobat, not Adobe Reader.

  • How do I extract pages from a pdf using 'Adobe PDF Pack'?

    How do I extract pages from a pdf using 'Adobe PDF Pack'?

    I think you have to buy extractor for 1.99 a month to extract PDF.  But I am having trouble activating it.  Good luck.

  • How do I extract audio from a movie?

    How do I extract audio from a movie I downloaded from iTunes and save it to my iTunes library to use as a ringtone?

    Do you have Qt Pro...?
    If not, you may be able to extract the audio with this free program:
    http://www.squared5.com/

  • How do I extract text from an email?

    Hello!
    I am in the process of trying to automate orders from my website. How do I extract text from an email and paste it into specific cells in an Excel spreadsheet using Automator?
    Many thanks,
    Toby Bateson

    If you select the message on the Inbox list, or open the message, you can then go to the Message menu of Mail and select Remove Attachments.
    Bob N.
    Mac Mini 1.5 GHz; iBook 900 mHz; iPod 20 GB   Mac OS X (10.4.7)  

  • How the data extraction happens from HR datasources from R/3 to BW system.

    Hello All
    How the data extraction happens from HR datasources from R/3 to BW system.Incase of delta records ( for CATS datasources ) ,Is there any flow like LO .
    Incase of Full and delta loads how does the data will be taken from R/3 to BW,DO we need to fill setup tables ?
    Searched forum but couldnt able to find the relevant one.
    Thankyou
    Shankar

    Hi Shankar.
    HR Datasources do not have setup tables . Though before implementation, certain customizations should be done and the delta loads have dependency on other data sources. Also you must have implemented Support Package SAPKH46C32, or have made the relevant corrections in SAP Note 509592.
    Follow this link for details on customization and dependencies for all CATS datasources.
    http://help.sap.com/saphelp_nw70/helpdata/en/86/1f5f3c0fdea575e10000000a114084/frameset.htm
    Regards,
    Swati

  • How do you extract pages from .indd to create a new .indd?

    How do you extract pages from .indd to create a new .indd?

    Laubender schrieb:
    @moseymums – two answers here:
    1. Duplicate the document and remove all not wanted pages.
    2.a Duplicate all selected pages in the Pages Panel to a different open InDesign file (the target) with the "Move Pages…" command.
    2.b Remove all unwanted pages from the target InDesign file.
    Uwe
    But take care on text threads accross several pages. If you delete a page with a text frame linked to a thread accross several pages, the text will change to the beginning of the thread on every first page.
    So it might be good to run a script which will unlink threadened text frames before.
    If you have often to do this task, there are several plugins which will help you to perform this. E.g. Output factory from http://zevrix.com/

  • How can I extract images from Numbers?

    Sounds a bit stupid but how do you extract images from Apples 'Numbers 3' on a Mac?  I have a client that sends images in XLS files, that normally in Word I would Alt Click and 'save as...'
    I was trying to stop using Word but this simple little feature will make all the difference.
    Can anyone point me in the right direction.
    Thanks,
    Dave

    Hi Wayne,
    Thank you for your response.  Sadly if you do this it copies in to the MACs clipboard as a snap shot of the image at the dimensions in Numbers.
    Eg. 
    An image I've extracted from the document via Excel saved out at it's original dimensions 1024 x 300px, even though it was placed, then scaled down to 300px wide on the sheet.
    Same image copied then pasted in to an image editor (as I couldn't paste into finder) was only 300px wide.
    The feature I need is to be able to save out the original image placed in the Numbers sheet.
    Anyone with ideas on this?

  • Extracting Year from the date field

    Hi,
    I want to extract year from the date field... I've tried following code but got the error
    SELECT to_char(a.A_EXPIRY_DATE,'yyyy') as EXP_YEAR from Table_A a
    Please advice
    Thanks in advance

    user12863454 wrote:
    SELECT to_char(a.A_EXPIRY_DATE,'yyyy') as EXP_YEAR from Table_A aThis should work and returns a string.
    What error did you get?
    maybe your column name is wrong? Is it really A_somthing? This is possible but slightly unusual.
    also possible
    select extract(Year from sysdate) from dual;
    /* with your table and column */
    SELECT extract(year from a.A_EXPIRY_DATE) as EXP_YEAR from Table_A a;Edited by: Sven W. on Aug 18, 2010 6:41 PM

  • How can i extract data from oracle table  to flat file or excel spread shee

    Hello,
    DB Version is 10.1.0.3.0
    How can i extract data from oracle table to flat file or excel spread sheet by using sub programs?
    Regards,
    D

    Here what I did
    SET NEWPAGE 0
    SET SPACE 0
    SET LINESIZE 80
    SET PAGESIZE 0
    SET ECHO OFF
    SET FEEDBACK OFF
    SET VERIFY OFF
    SET HEADING OFF
    SET MARKUP HTML OFF SPOOL OFF
    Sql> SPOOL bing
    select * from -------;
    SPOOL OFF;
    I do not see file.
    I also tried
    Sql> SPOOL /tmp/bing
    select * from -------;
    SPOOL OFF;
    But still not seeing the fie,

  • How can I extract image from complex (multycoloured0 background?

    How can I extract image from complex (multycoloured) shot?

    I would say either using the pen tool or the quick mask tool but without seeing how complex the image/background is I can't give you a complete answer...?
    Can you post the image?

  • How can I extract photos from my backup (5000+ photos) for free?

    How can I extract photos from my backup (5000+  photos) for free?

    eyal123 wrote:
    How can I extract photos from my backup (5000+  photos) for free?
    You cannot.
    Why are you opposed to paying for some software to help do what you want?
    You can restore the backup to your iPhone then sync the photos to your computer.

Maybe you are looking for

  • HTML Content in Email Notifications

    Hi I was wondering if HTML content is supported in BPM Email notifications. The html code in the BPM UI task email notification is coming as plain HTML in the email, can you please let me know if there is any flag that needs to be turned on to proces

  • HT201364 I just bought a new Macbook Pro and I'm not sure if I have the new Mavericks as my OS.

    I just bought a new Macbook Pro and under current operating system, it list OS X 10.9.1 as my current system and says I can update to Mavericks. Isn't 10.9.1 the newest OS for Mac? This is my first Mac and I'm not sure about the way it lists the OS s

  • Not Burning at 8x

    I have a 17inch MacBook Pro and I have been using Toast 7.1. However after the first several discs, I noticed a slow down in the burning time. I used to be able to burn movies in around 10-12 minutes at what I can only assume was 8x (I have an 8X Sup

  • Report group

    Dear experts,    I have a t-code 'ZF31'  when I see the status of this tcode the program name is showing like '<b>GP3NRV9GORPNJR0V3473BDOGINU250</b>'  in client 250.    When I execute the same program in client the 050 the program is not running sayi

  • Can't delete a large outgoing email

    I accidentally sent (am sending) a VERY LARGE email (200MB) and I cannot delete it while it's in the process of sending. I've tried DELETING it, dragging it to the trash, and nothing works. The huge file is really slowing everything down. HELP!!