Help with how to convert a string to a number ??

Hi All,
I am having problem converting a string to number.
Looks like my to_number function is not working.
Help is very much appreciated.
My query is below, and I know my problem is in my inner query.
I am getting the following error:
what am I doing wrong ? and how should I fix it.
If there is a better approach, please share it.
ORA-01722: invalid number
01722. 00000 -  "invalid number"
*Cause:   
*Action:
SELECT
    A.OBJECT_NAME,
    A.TIMESTAMP,
    A.SESSION_ID,
    A.REQUISITION_ID,
    TO_DATE(CUT(RR_PACE_FUNCTIONS.NAME(A.REQUISITION_ID),3,'.'),'YYYYMMDD') CSD,
    SUBSTR(SUBSTR(RR_PACE_FUNCTIONS.DESCRIPTION(A.REQUISITION_ID),9),1,30) COURSE_ID,
    A.WEEK_GROUP,
    A.APTITUDE_AREA,
    SUM(NVL(GTEP_ASGN,0)) GTEP_ASGN,
    SUM(NVL(AI_ASGN,0)) AI_ASGN,
    SUM(NVL(GTEP_ASGN,0) + NVL(AI_ASGN,0) ) BMT_ASGN
  FROM
    (SELECT OBJECT_NAME,
      SESSION_ID,
      TIMESTAMP,
      TO_NUMBER(FIELD1) REQUISITION_ID,  -- I believe here is the problem
      TO_NUMBER(FIELD2) WEEK_GROUP,     -- here as well
      SUBSTR(FIELD3,1,80) APTITUDE_AREA,
      TO_NUMBER(FIELD4) GTEP_ASGN,  -- here
      TO_NUMBER(FIELD5) AI_ASGN      -- here
    FROM RR_REPORT_QUEUES
    ) A
  GROUP BY OBJECT_NAME,
    TIMESTAMP,
    SESSION_ID,
    WEEK_GROUP,
    APTITUDE_AREA,
    REQUISITION_ID ;Many Thanks,

Are you sure Field1, Field2, Field4 and Field5 contain a number information in all rows?
If there is a non numeric String in your Field<x> columns in any row the error will occor.

Similar Messages

  • How to convert a string list to number list

    Hi
    I have a table1 that codeid is a number(2)
    and other table2 that obtain the codeidlist in a varchar2(50) where I save the codeid that I selected from table 1, I can be one o more : 1,2,4,5 etc.
    I wanna make this but It gives an error: Invalid Number
    Select * from tabla1
    where codeid i not in (select codelidlist
    from table2
    where cliente='Oscar')
    how can I solve that?

    if you want to get rid of the connect by level
    (not sure if it will speed things up or not)
    you could try model
    untested as I don't have your tables but something like
    /* Formatted on 4/11/2011 1:00:37 PM (QP5 v5.149.1003.31008) */
    with code_list as
    SELECT codelidlistt list
      FROM  table2
      where cliente = 'Oscar'
    MODEL RETURN UPDATED ROWS
       PARTITION BY (ROW_NUMBER () OVER (ORDER BY codelidlistt) rn)
       DIMENSION BY (0 d)
       MEASURES (codelidlistt)
       RULES
          ITERATE (1000) UNTIL codelidlistt[ITERATION_NUMBER] IS NULL
          codelidlistt [ITERATION_NUMBER + 1] =
                REGEXP_SUBSTR (codelidlistt[0],
                               '[^\,]+',
                               1,
                               ITERATION_NUMBER + 1))
    select *
      from table1
    where codeid not in (select list from code_list )Edited by: pollywog on Apr 11, 2011 1:03 PM

  • How to convert a string value to date

    Dear All,
    I am new to powershell script, i was trying to store a Ad user password set date to a variable add, add a number of days to get the expire date.
    but when i try to convert the variable to date value, I am getting the error as below.
    Please help me......
    PS C:\script> $passwordSetDate = (get-aduser user1 -properties * | select PasswordLastSet)
    PS C:\script> $passwordSetDate
    PasswordLastSet
    7/15/2014 8:17:24 PM
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    Cannot find an overload for "ParseExact" and the argument count: "3".
    At line:1 char:1
    + $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodException
        + FullyQualifiedErrorId : MethodCountCouldNotFindBest
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)

    Dear All,
    I am new to powershell script, i was trying to store a Ad user password set date to a variable add, add a number of days to get the expire date.
    but when i try to convert the variable to date value, I am getting the error as below.
    Please help me......
    PS C:\script> $passwordSetDate = (get-aduser user1 -properties * | select PasswordLastSet)
    PS C:\script> $passwordSetDate
    PasswordLastSet
    7/15/2014 8:17:24 PM
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    Cannot find an overload for "ParseExact" and the argument count: "3".
    At line:1 char:1
    + $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodException
        + FullyQualifiedErrorId : MethodCountCouldNotFindBest
    PS C:\script> $a = [datetime]::ParseExact($passwordSetDate,"MM/dd/yyyy HH:MM:SS", $null)
    In your post you ask how to convert a string value to a date.  The value returned from the Get-AdUser is already a date.  It does not need to be converted.
    Bill has sshown one way to convert a date to a string and there are other methods.  You need to clarify your question.
    If you are really trying ot convert strings to dates then you can start with this:
    [datetime]'01/21/1965 13:33:23'
    Most date strings aer autodetected by the class.
    ¯\_(ツ)_/¯

  • How to convert a String to an Icon

    Hello,
    I'm trying to figure out how to convert a String (specifically one letter) to an Icon for a JTree. The program I am working on uses .png files for the icons at the moment, with each .png being a single uppercase letter. However, recent discussion has us wanting to change to something more dynamic, since we anticipate needing new letters in the near future.
    My task is to modify the current codebase so that the Icons used to identify nodes in the tree are created from a Font within code, rather than reading in .png files. I have done some experimenting with creating a Label with just that String, setting the font and trying to extract the image using calls like createImage(int width, int height) and so on, but so far to no avail.
    If I could figure out how to at least convert the String to an image, I could probably make it work (since I can play around with creating an ImageIcon with that image). Thanks in advance for any help.
    Allan

    Here is some quick and dirty code:
    import java.awt.*;
    import javax.swing.*;
    public class BasicIcon implements Icon {
        private String text;
        public BasicIcon(String text) {
            this.text = text;
        public int getIconWidth() {
            return 16;
        public int getIconHeight() {
            return 16;
        public void paintIcon(Component c, Graphics g,  int x, int y) {
            Color old = g.getColor();
            g.setColor(c.getForeground());
            g.drawString(text, x, y+13);
            g.setColor(old);
        public static void main(String[] args) {
            JPanel cp = new JPanel();
            for (char ch = 'A'; ch < 'F'; ++ch) {
                cp.add(new JButton("letter " + ch, new BasicIcon(String.valueOf(ch))));
            JFrame f = new JFrame("BasicIcon");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setContentPane(cp);
            f.pack();
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    }One thing that could be improved is the vertical positioning of the letter in the Icon.
    The x,y values passed into paintIcon are the upper-left hand corner of the icon,
    but the y value needed by drawString is the position of the String's baseline.
    To do it right, use one of Font's getLineMetrics methods and play around with ascent.

  • How to convert a String("yyyy-mm-dd") to the same but in Date format ?

    Hi,
    can anyone plz tell me how to convert a String to a date format.I'm using MSACCESS database.I want to store this string in the database.So i need to convert it to a date format since the table is designed such a way with date/time type for date field.I used SimpleDateFormat ,but i can't able to convert.The code is given below:
    coding:
    public String dateconvertion(String strDate)
    try
    SimpleDateFormat sdfSource = new SimpleDateFormat("yyyy-MM-dd");
    Date date = sdfSource.parse(strDate);
    SimpleDateFormat sdfDestination = new SimpleDateFormat("yyyy-MM-dd ");
    strDate = sdfDestination.format(date);
    catch(ParseException pe)
    System.out.println("Parse Exception : " + pe);
    return(strDate);
    }

    i used prepared statement even now i am getting error like this.....
    i have included the prepared statement package also...
    my coding:
    ResultSet rsdatetemp = null;
    PreparedStatement ps = null;
    String query ="select distinct itemcode from sales where bill date between ? and ?";
    ps = precon.prepareStatement(query);
    ps.setDate(1,d1);//d1 and d2 are in date format
    ps.setDate(2,d2);
    rsdatetemp = ps.executeQuery();
    error :
    symbol : method setDate(int,java.util.Date)
    location: interface java.sql.PreparedStatement
    ps.setDate(1,d1);
    symbol : method setDate(int,java.util.Date)
    location: interface java.sql.PreparedStatement
    ps.setDate(2,d2);

  • Need help with how to reset bios and admin password to reformat hard drive in 8440p elitebook.......

    need help with how to reset bios and admin password to reformat hard drive in 8440p elitebook? removal of cmos, resetting laptop, using cccleaner, windows password recovery and hiren's was noneffective, any help is appreciated. thanks

    Hi,
    As your notebook is a business class machine, security is more stringent - the password is stored in non-volatile memory and there are no 'backdoor' passwords.  Your best option would be to contact HP regarding this.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • How to convert a string from upper case to lower case in FOX formula

    Hi Experts,
    How to convert a string from upper case to lower case in FOX formula?
    Thanks,
    Cheers!!!
    PANKAJ

    The last result.append( c ) should be:
    result.append( Character.toLowerCase(c) );

  • How to convert a string from lower case to upper case withour using transla

    Hi all,
    how to convert a string from lower case to upper case withour using translate,
    Thanks in Advance,
    Reddy

    Refer to this related thread
    Re: hi guys this very urgent please help

  • I have an itouch, most songs i got off my cd's. i have a new laptop and want to put songs from itouch to laptop.I can only get the songs that i purchased onto the laptop? need help with how to get the rest from itouch to laptop please??

    i have an itouch, most songs i got off my cd's. i have a new laptop and want to put songs from itouch to laptop.I can only get the songs that i purchased onto the laptop? need help with how to get the rest of the songs (from my cd's) from itouch to laptop please??

    See this previous discussion:
    Recovering your iTunes library from your iPod or iOS device: Apple Support Communities

  • How to convert a String to an array

    Can somebody tell me how to convert a String to an array

    ronisto wrote:
    Can somebody tell me how to convert a String to an arrayI assume you mean to convert it into an array of the individual characters that comprise the String.
    Can you not simply look at the API documentation? Nothing in the String API jumps out at you?
    http://java.sun.com/javase/6/docs/api/index.html

  • How to convert an int variable into Number

    Hi all,
    I am using Jdeveloper 11.1.1.2
    When I insert a row in a entity object I want to create another row in another entity object, but when I am setting the attribute for the new row I have a problem.
    Here is the code:
    int a = EO1Impl.paramA;
    NameEO2Impl.setAttribute("Attribute1", a);
    The error is that variable a is an int, while Attribute1 is a Number.
    How can convert an int to a Number.
    Thank you.

    Andrea9,
    If a, as you say is an int, and assuming you mean an oracle.jbo.domain.Number,
    NameEO2Impl.setAttribute("Attribute1", new oracle.jbo.domain.Number(a));works just fine.
    John

  • How to convert a string to a currency value ? getting a dump with exception

    Hi,
    I am getting a exception not caught in CX_SY_CONVERSION_NO_NUMBER.
    I am trying to convert a string value with ',' to a currency value.
    I tried using Replace and Condense. But the error still persists.
    Is there a FM or a casting that I can use?
    Cheers
    Kiran

    Hi,
    Sorry I got my question wrong. I have a problem - that when I'm trying to pass a value from a string to a currency field.
    But, the currency field is a field symbol.
    so, I have
    data abc type string.
    abc = "5345"
    <curr_val> = abc.
    now <curr_val> = 0.000
    Please suggest.

  • How to convert a string to date and then compare it with todays date???

    Hello.
    I want to set a format first for my dates
    DateFormate df = new SimpleDateFormate("yyyy-mm-dd");
    once this is done then I want to convert any string to date object in the above formate
    String str="2001-07-19";
    Date d = null;
    try{
    d = df.parse(s);
    }catch(ParseException pe) {
    pe.printStackTrace();
    First of all there is something wrong above,cus what I get for this is
    Fri Jan 19 00:07:00 MST 2001
    where as it should have been
    2001-07-19... to my understanding.
    once this part is done I need to get current date in the above set format and compare the
    current date and the date I set.
    I will appreciate the help.
    Thanks

    for the output part:
    a date is a point in time
    the output depends on the format you specify for output
    using for example a SimpleDateFormat.
    You only specified the format for parsing (which is independent for that of output) so java uses some default format ... see the DateFormat.format() method for details.
    for the comparison stuff, I just posted a little code snippet in this forum a few minutes ago.
    the hint is: Date.getTime() returns milliseconds after a fixed date
    hth Spieler

  • Help with calculated column formula- combine strings and convert to date

    In my list (SharePoint Server 2013) I have:
    'Invoiced Month' column, type of choice (strings with names of months- January, February, March..., December)
    'Year' column, single line of text (e.g. 2012, 2013, 2014)
    1. I need to create a calculated column which will return combined value of the columns above, but in DATE format e.g. 'Sep-2013' or '01-Sep-2013'.
    I then use that newly created calculated column to do this: http://iwillsharemypoint.blogspot.in/2012/03/sharepoint-list-view-of-current-month.html
    I am rubbish with formulas, can I have some help with my problem please?

    Hi,
    Use the formula, I have tested by creating Months column with choice, Year column as numeric and Calculated column as DateTime returned.
    =DATE(Year,IF([Months]="January", 1,IF([Months]="February",2,IF([Months]="March",3,IF([Months]="April",4,IF([Months]="May",5,IF([Months]="June",6,IF([Months]="July",7,IF([Months]="August",8,IF([Months]="September",9,IF([Months]="October",10,IF([Months]="November",11,12))))))))))),1)
    Before applying the formula few things need to be noted.
    DATE(YEAR, MONTH,DAY) will accepts three parameters all should be type numeric(integer).
    Create the Year column of type numeric
    Create the calculated column of type "DateTime" to return as date
    Please mark it answered, if your problem resolved or helpful.

  • How to convert a string into an objects name?

    Hi
    I have the following problem;
    I have a string
    String a = "e1"
    and a method
    call(Event e1) that calls the "Event" class with object the name of the string a.
    How can I convert the strings name into an object so as to use it in the "call" method?
    Any ideas?
    Thanks in advance

    I don't know if this helps you, but you can do things like this.
    String a = "com.example.SomeEvent";
    //Instantiate com.example.SomeEvent
    Object o = Class.forName(a).newInstance();SomeEvent must have a non-argument constructor for this to work.
    Class that will be instantiated depens on runtime value of String a, and can be different across different executions of the program.

Maybe you are looking for

  • I have an early 2009 iMac need advice

    I am new to this forum. As I mentioned in subject I have an early 2009 iMac with 4 GB of Ram. I am up to date with my operating system, running Yosemite 10.10.1. My problem is that my computer is slow - very slow.  It takes forever for the computer t

  • [Solved]How to create ADF interface View

    Hi All, I have a design problem that I need some help with. In one of the pages in our application, we have two drop down boxes one with account type and another with account name (label) and account number (value). The account types are Escrow, Cred

  • Yellow broadband light then no internet

    Hi there. Can someone please help me. For the last couple of weeks the yellow broadband light will come on on my home hub, then on my laptop it will disconnect me off the internet with the computer screen saying the yellow light is on unable to conne

  • Korean symbols in JFileChooser

    Hi, I have a big problem with Korean characters in JFileChooser. When I browse to a folder with Korean symbols, all I see are some "???" instead of the real symbols. Can anybody tell me what should I do to display them correctly in the JFileChooser ?

  • HT1212 wifi have problem iphone 4s

    my iphone 4s wifi have some problem. what i can do for it?