Trying to complete profile - get invalid number error

I'm attempting to complete my Skype profile, but am running into a problem when trying to enter my mobile number.  I've entered it as xxxxxxxxxx and xxx-xxx-xxxx, neither seems acceptable. The error says, "It looks like you entered an invalid number - try again, so friends will have more ways to contact you." Not sure what I'm doing wrong.  I'm in the US and am attempting to use Skype Web (beta).  Need to use this for a call on Monday.

Your first literal is not a date, assuming you didn't set NLS_DATE_FORMAT.
So the code should have been
SELECT TO_CHAR(to_date('2010-JUN-23','YYYY-MON-DD'), 'YYYY-MM-DD') FROM DUAL;
Please note DATEs are always converted to VARCHAR2 when you SELECT them, using NLS_DATE_FORMAT.
When you use a DATE string literal it ias always implicitly converted to a real date, by using NLS_DATE_FORMAT.
So if you want all your dates formatted as YYYY-MON-DD, you need to set NLS_DATE_FORMAT to that mask.
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • TO_CHAR to convert date getting 'Invalid number' error

    I am trying to convert a static date value using TO_CHAR function but I can't believe I am not able to do it such a simple conversion.
    //Obviously this is easy and everyone would like to give this as an example and this is what I see everwhere on Google and it works.
    SELECT TO_CHAR(sysdate, 'YYYY-MM-DD') FROM DUAL;
    How can I make it work like this?
    SELECT TO_CHAR('2010-JUN-23', 'YYYY-MM-DD') FROM DUAL;
    I keep getting "Invalid number" error. I changed my constant date to different formats but none works.

    Your first literal is not a date, assuming you didn't set NLS_DATE_FORMAT.
    So the code should have been
    SELECT TO_CHAR(to_date('2010-JUN-23','YYYY-MON-DD'), 'YYYY-MM-DD') FROM DUAL;
    Please note DATEs are always converted to VARCHAR2 when you SELECT them, using NLS_DATE_FORMAT.
    When you use a DATE string literal it ias always implicitly converted to a real date, by using NLS_DATE_FORMAT.
    So if you want all your dates formatted as YYYY-MON-DD, you need to set NLS_DATE_FORMAT to that mask.
    Sybrand Bakker
    Senior Oracle DBA

  • TO_NUMBER getting invalid number error

    I want to use TO_NUMBER function to converse some float number,
    but the following query always gets invalid number error:
    select to_number('12.1073') from dual;
    but if I add the format in, it runs as expected:
    select to_number('12.1073', '99.9999') from dual;
    From the syntax, the format parameter is optional, is it only optional for integers?
    Thanks!

    Same here.
    So, or you replace dot by comma, or you change the territory (or nls_numeric_characters) defined for your session :
    SQL> select to_number('12.1073') from dual;
    select to_number('12.1073') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    Elapsed: 00:00:00.00
    SQL> alter session set nls_territory='america';
    Session altered.
    Elapsed: 00:00:00.00
    SQL> select to_number('12.1073') from dual;
    TO_NUMBER('12.1073')
                 12.1073
    Elapsed: 00:00:00.00
    SQL> alter session set nls_territory='france';
    Session altered.
    Elapsed: 00:00:00.00
    SQL> select to_number('12.1073') from dual;
    select to_number('12.1073') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    Elapsed: 00:00:00.00
    SQL> alter session set nls_numeric_characters='.,';
    Session altered.
    Elapsed: 00:00:00.00
    SQL> select to_number('12.1073') from dual;
    TO_NUMBER('12.1073')
                 12.1073
    Elapsed: 00:00:00.00
    SQL> Nicolas.

  • Please help getting invalid number error.

    Hi Experts,
    My requirement is
    If DT_ID value of xmlmsg existed in the DT_ID of PART_ID_COLLES table then that record should be processd else should be skipped.
    And xmlmsg of PART_ID should start with "A" and followed only by the number then that record should be processed else should be skipped.
    And xmlmsg of DD_DAYS should contain only  the number and grater than or equal to 0 ,then that record should be processed else should be skipped.
    For that I have written this code.
    But if I pass dt_id as string value in xmlmsg I am getting invalid number error.
    DT_ID of PART_ID_COLLES table is number data type.
    SELECT xmlmsg.part_id part_id,xmlmsg.dd_days dd_days,xmlmsg.dt_id dt_id
                      FROM XMLTABLE(
                            XMLNAMESPACES(
                                'urn:schemas-microsoft-com:rowset' as "rs"
                              , '#RowsetSchema' as "z"
                            '/z:row[not(@dt_id=following-sibling::z:row/@dt_id and @part_id=following-sibling::z:row/@part_id)]'
                            PASSING p_dd_days_vals
                            COLUMNS
                                ITEM_NO             for ordinality
                              , dt_id    VARCHAR2 (20) path '@dt_id'
                              , part_id  VARCHAR2 (25) path '@part_id'
                              , dd_days  VARCHAR2 (20) path '@dd_days'
                           ) xmlmsg,
                           part_id_colles pic
                           WHERE REGEXP_REPLACE(TRIM(xmlmsg.dt_id),'^([0-9]+)$|.','\1') = pic.dt_id
                                 AND REGEXP_LIKE (UPPER(TRIM(xmlmsg.part_id)),'^[A][0-9]+$')
                                 AND (TO_NUMBER(REGEXP_REPLACE(TRIM(xmlmsg.dd_days),'^([0-9]+)$|.','\1')) >=0
                                 AND REGEXP_LIKE(TRIM(xmlmsg.dd_days), '^-?[[:digit:],.]*$') ;
    Sample message is
    <MESSAGES>
    <MESSAGE ID="12345">
      <MSG_ID>3026900</MSG_ID>
      <DT_POSTED>6/20/2013 08:15:48</DT_POSTED>
      <POSTED_BY>GPD_MSG_EXTRACTOR</POSTED_BY>
      <DT_LAST_QUEUED />
    <MSG>
    <WORK_SET TRANSACTION_ID="@TRANS_ID" TRANSACTION_TYPE="Batch" IS_ACID="@IS_ACID">
    <WORK_UNIT GROUP="dd_days" ACTION="ADD" AFFECTED="dd_days">
    <RECORDSET TABLE_NAME="dd_days">
    <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    <rs:data>
      <z:row dt_id="430" part_id="A5556689" dd_days="10"/>
      <z:row dt_id="550A" part_id="A8889965" dd_days="20"/>
      </rs:data>
      </xml>
      </RECORDSET>
      </WORK_UNIT>
      </WORK_SET>
      </MSG>
      </MESSAGE>
      </MESSAGES>
    Please help me.
    Thanks.

    Your code has ton of errors. Anyway:
    with part_id_colles as (
                            select 430 dt_id,xmltype('<MESSAGES>
    <MESSAGE ID="12345">
      <MSG_ID>3026900</MSG_ID>
      <DT_POSTED>6/20/2013 08:15:48</DT_POSTED>
      <POSTED_BY>GPD_MSG_EXTRACTOR</POSTED_BY>
      <DT_LAST_QUEUED />
    <MSG>
    <WORK_SET TRANSACTION_ID="@TRANS_ID" TRANSACTION_TYPE="Batch" IS_ACID="@IS_ACID">
    <WORK_UNIT GROUP="dd_days" ACTION="ADD" AFFECTED="dd_days">
    <RECORDSET TABLE_NAME="dd_days">
    <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    <rs:data>
      <z:row dt_id="430" part_id="A5556689" dd_days="10"/>
      <z:row dt_id="550A" part_id="A8889965" dd_days="20"/>
      </rs:data>
      </xml>
      </RECORDSET>
      </WORK_UNIT>
      </WORK_SET>
      </MSG>
      </MESSAGE>
      </MESSAGES>') p_dd_days_vals from dual)
    SELECT  xmlmsg.part_id part_id,
            xmlmsg.dd_days dd_days,
            xmlmsg.dt_id dt_id
      FROM  part_id_colles pic,
            XMLTABLE(
                     XMLNAMESPACES(
                                   'urn:schemas-microsoft-com:rowset' as "rs",
                                   '#RowsetSchema' as "z"
                     '/MESSAGES/MESSAGE/MSG/WORK_SET/WORK_UNIT/RECORDSET/xml/rs:data/z:row[not(@dt_id=following-sibling::z:row/@dt_id and @part_id=following-sibling::z:row/@part_id)]'
                     PASSING p_dd_days_vals
                     COLUMNS
                        ITEM_NO             for ordinality,
                        dt_id    VARCHAR2 (20) path '@dt_id',
                        part_id  VARCHAR2 (25) path '@part_id',
                        dd_days  VARCHAR2 (20) path '@dd_days'
                    ) xmlmsg
      WHERE REGEXP_REPLACE(TRIM(xmlmsg.dt_id),'^([0-9]+)$|.','\1') = pic.dt_id
        AND REGEXP_LIKE(UPPER(TRIM(xmlmsg.part_id)),'^[A][0-9]+$')
        AND TO_NUMBER(REGEXP_REPLACE(TRIM(xmlmsg.dd_days),'^([0-9]+)$|.','\1')) >=0
        AND REGEXP_LIKE(TRIM(xmlmsg.dd_days), '^-?[[:digit:],.]*$')
    PART_ID                   DD_DAYS              DT_ID
    A5556689                  10                   430
    SQL>
    SY.

  • Invalid number error when calculating with sysdate

    Hello - I am getting invalid number error for query below:
    SELECT *
    FROM
    trkg
    WHERE
    trkg.tran_type=500
    AND
    trkg.mod_date_time>sysdate-0.5
    I am not sure what is wrong with above query. Strange part is that it executes fine in one environmnet and returns 'invalid number' error in other environmnet? Please help me find missing setting.

    more information:
    Table1: LOCN_HDR with field locn_brcd and locn_id
    locn_brcd locn_id
    26001A 0000086
    26002A 0000087
    26001B 0000088
    Table2: PICK_LOCN with field LOCN_ID
    locn_id
    0000086
    0000087
    0000088
    Table3: TRKG with field from_locn and mod_date_time (this is timestamp field)
    from_locn mod_date_Time
    0000086 29-MAY-13 10.09.23.000000000 AM
    0000087 29-MAY-13 10.11.48.000000000 AM
    0000088 31-MAY-13 04.07.21.000000000 PM
    Now I combine Table1 and Table3
    select * from appwms.locn_hdr lh
    join
    (SELECT lh.locn_brcd,trkg.mod_Date_Time from appwms.trkg
    join appwms.locn_hdr lh
    on trkg.FROM_LOCN = lh.LOCN_ID
    where
    trkg.TRAN_TYPE = 500
    and trkg.mod_Date_time>sysdate-5
    ) trkg1 on lh.locn_brcd=trkg1.locn_brcd
    -- returns values correctly
    Now when I join another table to above (ie table 2), it returns 'invalid number'
    select * from appwms.locn_hdr lh
    join
    (SELECT lh.locn_brcd,trkg.mod_Date_Time from appwms.trkg
    join appwms.locn_hdr lh
    on trkg.FROM_LOCN = lh.LOCN_ID
    where
    trkg.TRAN_TYPE = 500
    and trkg.mod_Date_time>sysdate-5
    ) trkg1 on lh.locn_brcd=trkg1.locn_brcd
    join
    (select pld.locn_id,lh.locn_brcd
    from APPWMS.PICK_LOCN PLD join appwms.locn_hdr lh
    on pld.locn_id = lh.LOCN_ID ) picklocn on picklocn.locn_brcd=lh.locn_brcd
    why are rows returned with one join? when i have more than one join why does it return error 'invalid number'.

  • When calling to phone, I get "Invalid number" to n...

    Hi,
    I had SIM card from one mobile provider in Ireland and I have moved my number to other mobile provider. After successful transfer I am not able to call to my number (+35389xxxxxxx) from skype and I get "invalid number" error message.
    I was able to call before transfer.
    Is it skype problem or new mobile provider bad transfer problem?
    Thanks
    Solved!
    Go to Solution.

    SauLius wrote:
    Is new mobile provider bad transfer problem?
    Yes it is. Please contact your provider.
    TIME ZONE - US EASTERN. LOCATION - PHILADELPHIA, PA, USA.
    I recommend that you always run the latest Skype version: Windows & Mac
    If my advice helped to fix your issue please mark it as a solution to help others.
    Please note that I generally don't respond to unsolicited Private Messages. Thank you.

  • Getting ORA-01722 invalid number error

    what is wrong with the query throwing invalid number error
    SELECT NVL(OPT_WA_FAIR_VAL_A,0)
    FROM AUDIT_GRN ag
    WHERE ag.ORG_GRP_I = 1
    AND ag.GRN_N = 2
    AND (ag.ED_EFF_M,NVL(ag.ED_END_M,SYSDATE)) IN (SELECT MAX(ED_EFF_M),MAX(NVL(ED_END_M,SYSDATE))
    FROM AUDIT_GRN ag2
    WHERE ag2.ORG_GRP_I= ag.org_grp_i
    AND ag2.grn_n=ag.grn_n
    AND To_Date(To_Char(ag2.ED_EFF_M,'MM/DD/YYYY'),'MM/DD/YYYY') <= TO_DATE(TO_CHAR('08/04/06','MM/DD/YYYY'),'MM/DD/YYYY')
    AND To_Date(To_Char(NVL(ag2.ED_END_M,SYSDATE),'MM/DD/YYYY'),'MM/DD/YYYY') >= TO_DATE(TO_CHAR('08/04/06','MM/DD/YYYY'),'MM/DD/YYYY'));

    Error occurs at this line-excluding these line iam getting output
    Audit _grn striucture is
    org_grp_i number(6)
    grn_n number
    ed_eff_m timestamp(6)
    ed_end_m timestamp(6)
    OPT_WA_FAIR_VAL_A number(18,6)
    AND To_Date(To_Char(ag2.ED_EFF_M,'MM/DD/YYYY'),'MM/DD/YYYY') <= TO_DATE(TO_CHAR('08/04/2006','MM/DD/YYYY'),'MM/DD/YYYY')
    AND To_Date(To_Char(NVL(ag2.ED_END_M,SYSDATE),'MM/DD/YYYY'),'MM/DD/YYYY') >= TO_DATE(TO_CHAR('08/04/2006','MM/DD/YYYY'),'MM/DD/YYYY'));

  • Trying to update to itunes 11.1 getting invalid signature error message

    getting invalid signature error message when trying to upgrade itunes 11.1...help me please?

    iTunes: Specific update-and-restore error messages and advanced troubleshooting
    http://support.apple.com/kb/TS3694
    Try this - Disable your firewall and anitvirus software temporarily.  Then download and install the iOS update.
     Cheers, Tom

  • ORA-01722: invalid number error when trying to pass a list of values

    Gurus
    We are using a function like so
    The usage for the function below is
    Select fn_st_bb_nm_uc (‘1232131312, 123213312’) from dual;
    SQL> /
    Select fn_st_bb_nm_uc ('1232131312, 123213312') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    It’s giving an invalid number error. When we pass one value it is working fine but when we pass a string of values it gives this error. I have opened an SR around this but would greatly appreciate your help
    Acc_blackbar is the table and acc_blkbr_id is of type number.
    FUNCTION fn_st_bb_nm_uc (pBB_ID_LIST VARCHAR2)
    RETURN VARCHAR2 IS
    vspcm_typ_nm_uc VARCHAR2 (2000);
    CURSOR stname
    IS
    SELECT distinct st.spcm_typ_nm_uc
    FROM
    acc_blackbar abb,
    acc_specimen_type ast, acc_procedure apr,
    acc_specimen_part asp,
    specimen_type st, procedure pr,
    proc_proc_family ppf
    WHERE abb.ACC_BLKBR_ID = apr.ACC_BLKBR_ID
    AND apr.ACC_SPCM_PART_ID = asp.ACC_SPCM_PART_ID
    AND asp.ACC_SPCM_TYP_ID = ast.ACC_SPCM_TYP_ID
    AND ast.ACC_SPCM_TYP_SPCM_TYP_ID = st.SPCM_TYP_ID
    AND apr.procdr_id = pr.PROCDR_ID
    AND pr.PROCDR_ID = ppf.PROCDR_ID
    AND abb.acc_blkbr_id in (pBB_ID_LIST) ;
    BEGIN
    DBMS_OUTPUT.PUT_LINE(' BB LIST : ' || pBB_ID_LIST);
    FOR st IN stname
    LOOP
    vspcm_typ_nm_uc := vspcm_typ_nm_uc || ',' || st.spcm_typ_nm_uc;
    END LOOP;
    vspcm_typ_nm_uc := SUBSTR (vspcm_typ_nm_uc, 2);
    RETURN vspcm_typ_nm_uc;
    END;

    This ask tom thread covers multiple solutions:
    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425]

  • Case When Statement and ORA:01722 Invalid number error

    Hi folks, I have posted this under another heading as well under E-business suite so apologies if some you have already seen it but I would really appreciate some help on this one. Any suggestions are most welcome.
    We are trying to put together a calculation that returns the number of days absent an individual has had in a given time period. We need to cater for those absences that started before the period and are closed during it, absence that start during the period and end after it, and those that open and close within it.
    The period is always a rolling 6 months from sysdate.
    This is the calc we have come up with so far which works for some people but we get the invalid number error if the absence includes a half day - so 0.5, 1.5,etc.
    This is probably over complicated but we are not techie at all so are learning as we go!
    We are using the HRMS - Administration - Oracle Human Resources (Core) business area in 10G and the Absence Attendance and Person folders.
    SUM(TO_NUMBER(NVL(( CASE WHEN Absence Attendance.Actual Start Date < TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') THEN ( CASE WHEN Absence Attendance."Actual End Date" > SYSDATE THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),SYSDATE) ) ELSE ( CASE WHEN ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) END ) END ) END ) IS NULL THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),SYSDATE) ) ELSE ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) END ) END ) END ) END ) END ) ELSE ( CASE WHEN ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) END ) END ) END ) IS NULL THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),SYSDATE) ) ELSE ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( Absence Attendance.Duration Days ) END ) END ) END ) END ) END ),( DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") )),'999999990D00'))

    Hi,
    It could be that this is because you are using SYSDATE which contains the time as a fraction rather than TRUNC(SYSDATE) which just contains the current time. It could be that your working_dates_between raises this error.
    However, your formula is far more complicated than it needs to be.
    Firstly, you want to look at the date window ADD_MONTHS(TRUNC(SYSDATE), -6) to TRUNC(SYSDATE). Then you want to look at the portion of the absence that falls in the date window. This is GREATEST(Absence Attendance.Actual Start Date, ADD_MONTHS(TRUNC(SYSDATE), -6)) to LEAST(NVL(Absence Attendance."Actual End Date",TRUNC(SYSDATE)), TRUNC(SYSDATE)). You may need to add 1 to the absence end date because this is the last day of their absence rather than the date they return. It depends how you calculate the days between the start and end
    date of the absence. You can create calculations for the start and end date of the absences within the 6 months time window. Create calculation AbsenceStart as
    GREATEST(Absence Attendance.Actual Start Date, ADD_MONTHS(TRUNC(SYSDATE), -6))
    and AbsenceEnd as
    LEAST(NVL(Absence Attendance."Actual End Date",TRUNC(SYSDATE)), TRUNC(SYSDATE))
    Then you need to only pick up absence that a part of the absence in your 6 month date window. You can use a condition in the workbook or a condition in a case statement to do this. You then need to calculate the difference between these dates and SUM all the values.
    SUM(CASE WHEN AbsenceEnd >= AbsenceStart THEN WORKING_DAYS_BETWEEN(AbsenceStart, AbsenceEnd) END)
    That's it. Not so complicated after all.
    Rod West

  • Case When Statement and ORA:1722 Invalid number error

    Sorry I posted this in the wrong forum - I have the answer now
    Cheers
    HELP!!!
    We are trying to put together a calculation that returns the number of days absent an individual has had in a given time period. We need to cater for those absences that started before the period and are closed during it, absence that start during the period and end after it, and those that open and close within it.
    The period is always a rolling 6 months from sysdate.
    This is the calc we have come up with so far which works for some people but we get the invalid number error if the absence includes a half day - so 0.5, 1.5,etc.
    This is probably over complicated but we are not Techie at all so are learning as we go! We are using the HRMS - Administration - Oracle Human Resources (Core) business area in 10G and the Absence Attendance and Person folders.
    SUM(TO_NUMBER(NVL(( CASE WHEN Absence Attendance.Actual Start Date < TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') THEN ( CASE WHEN Absence Attendance."Actual End Date" > SYSDATE THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),SYSDATE) ) ELSE ( CASE WHEN ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) END ) END ) END ) IS NULL THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),SYSDATE) ) ELSE ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) END ) END ) END ) END ) END ) ELSE ( CASE WHEN ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) END ) END ) END ) IS NULL THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),SYSDATE) ) ELSE ( CASE WHEN TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY') >= Absence Attendance.Actual Start Date THEN ( WORKING_DAYS_BETWEEN(TO_DATE(ADD_MONTHS(SYSDATE,-6),'DD-Mon-YYYY'),Absence Attendance."Actual End Date") ) ELSE ( CASE WHEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") ) IS NULL THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( CASE WHEN SYSDATE <= Absence Attendance."Actual End Date" THEN ( WORKING_DAYS_BETWEEN(Absence Attendance.Actual Start Date,SYSDATE) ) ELSE ( Absence Attendance.Duration Days ) END ) END ) END ) END ) END ),( DAYS_BETWEEN(Absence Attendance.Actual Start Date,Absence Attendance."Actual End Date") )),'999999990D00'))
    Edited by: CPearce on Sep 25, 2008 8:03 AM

    Hi,
    It could be that this is because you are using SYSDATE which contains the time as a fraction rather than TRUNC(SYSDATE) which just contains the current time. It could be that your working_dates_between raises this error.
    However, your formula is far more complicated than it needs to be.
    Firstly, you want to look at the date window ADD_MONTHS(TRUNC(SYSDATE), -6) to TRUNC(SYSDATE). Then you want to look at the portion of the absence that falls in the date window. This is GREATEST(Absence Attendance.Actual Start Date, ADD_MONTHS(TRUNC(SYSDATE), -6)) to LEAST(NVL(Absence Attendance."Actual End Date",TRUNC(SYSDATE)), TRUNC(SYSDATE)). You may need to add 1 to the absence end date because this is the last day of their absence rather than the date they return. It depends how you calculate the days between the start and end
    date of the absence. You can create calculations for the start and end date of the absences within the 6 months time window. Create calculation AbsenceStart as
    GREATEST(Absence Attendance.Actual Start Date, ADD_MONTHS(TRUNC(SYSDATE), -6))
    and AbsenceEnd as
    LEAST(NVL(Absence Attendance."Actual End Date",TRUNC(SYSDATE)), TRUNC(SYSDATE))
    Then you need to only pick up absence that a part of the absence in your 6 month date window. You can use a condition in the workbook or a condition in a case statement to do this. You then need to calculate the difference between these dates and SUM all the values.
    SUM(CASE WHEN AbsenceEnd >= AbsenceStart THEN WORKING_DAYS_BETWEEN(AbsenceStart, AbsenceEnd) END)
    That's it. Not so complicated after all.
    Rod West

  • Invalid number error with Form on table page

    We used the "Form on Table..." wizard to create a simple page to update the SCOTT.EMP table. When we submit the page we get the ORA-01722: invalid number error. When I view the data in the WWV_FLOW_DATA view in the FLOWS_010500 schema, I can see all the data from our form in long format with the actual values that were submitted. But I can not track down where this error is coming from.

    James,
    What data did you enter in each field? Could it be as simple as you tried to enter character data into the deptno column?
    Sergio

  • Invalid Number Error Please help Urgent

    Hi,
    I am trying to create a report in discoverer where in I get an invalid number error for the statement
    ,DECODE(final.TYP,'Sales',to_char(final.future_supplpy),'B/O','B/O') sale_type.
    We have the requirement that when TYP is Sales i need to display future supply and when the TYP is B/O i need to display B/O.
    The query runs perfectly fine in TOAD but in Discoverer Desktop when i run the report i get an error message
    invalid number.
    Please help its urgent
    Thanks
    Ashwini

    Hi Ashwani
    First of all, your statement appears to not be handling anything other than Sales or B/O. Is that deliberate? If not, you need a default, catch all value at the end like this:
    DECODE(final.TYP,'Sales',NVL(final.future_supply,to_char(final.future_supply),'B/O','B/O', default_value) sale_type
    You also might want to make sure there aren't any NULL values in future_supply or in TYP and if there are you might want to consider using an NVL for these, like this:
    DECODE(final.TYP,'Sales',NVL(to_char(final.future_supply,NULL),'B/O','B/O', default_value) sale_type
    Also, when using DECODE you don't always need to use TO_CHAR as the DECODE conversion to a string typically takes place automatically. CASE is different as it insists that all results are of the same data type.
    Hope this helps
    Best wishes
    Michael

  • Invalid number error , number column as last field in my csv

    LOAD DATA
    INFILE 'test.csv' "str '#'"
    APPEND
    INTO TABLE esgapp.c_test
    FIELDS TERMINATED BY "," Optionally enclosed by '"'
    TRAILING NULLCOLS
    rstring,
    rtext char(12000) ENCLOSED BY '<start>' and '<end>',
    ruser,
    rid SEQUENCE(MAX,1)
    This control file is working good . But what i have done is i have altered my table *ruser* column which was earlier varchar now it is number . the data in the ruser is number , now i am getting an error while executing the the script
    it is throwing an invalid number error .
    i have tried this changes before i post this post in the control file but all are throwing the invalid number error
    ruser char "to_number(rtrim(ltrim(:ruser)))"
    and
    ruser decimal external
    csv file
    hello,<start>bla...bla...bla...bla,-996203
    error
    invalid number
    Edited by: user7955917 on Mar 5, 2012 9:34 AM
    Edited by: user7955917 on Mar 5, 2012 9:41 AM
    Edited by: user7955917 on Mar 5, 2012 9:42 AM

    But....If your Oracle version is 10g+, you can define the file as external table and use the "RECORDS DELIMITED BY '#'" parameter.
    :p

  • Getting invalid password error while logging onto application from frontend

    Hi Guys
    I am trying to login to one of our clones and i am getting invalid password error.
    I ran fndcpass and change my username's password which got changed successfully
    But still when i login to application using my username i am getting invalid password error
    I am getting the same error if i login as sysadmin
    Please suggest to resolve this
    thanks !!

    Hi,
    I am trying to login to one of our clones and i am getting invalid password error.What is the application release?
    Please post the complete error message -- Also, check Apache log files for details (error_log* and access_log*).
    I ran fndcpass and change my username's password which got changed successfullyWhat username password have you changed?
    But still when i login to application using my username i am getting invalid password error
    I am getting the same error if i login as sysadminDoes this happen when login as any application user?
    Please verify that none of those users are end-dated.
    Regards,
    Hussein

Maybe you are looking for

  • I moved the project files and now I can't get them back into iMovie 11

    I was working on a project but I ran out of disk space before I could finish it. Now, for this very purpose, I have an external hard drive with plenty of space on it. So I tried moving the folder with all my project files onto the external hd, and no

  • Is this really the only way to download a CD to iTunes? It's way too slow...

    Hi, I have tons of CDs I want to upload into iTunes using my new Dell computer. I just inserted my first CD. It has 11 songs and says it will take 39.8 minutes and is taking as long to download each song as it does to listen to it. This is not going

  • Can you change the background colors in templates on Pages?

    I love the newsletter templates in Pages, but I can't figure out a way to change the background color. I am supposed to use specific colors so I was hoping there was a way to change the background colors in some of the tables. Is there a way?

  • Scroll Timeline in a Div?

    Example: http://www.bartmclaughlin.com/scroll_div/scroll_div_v1.html Edge project: https://www.yousendit.com/download/elNJc2ZOR0Y1R1BWUThUQw Now I want to control the timeline of a symbol on the stage using scroll. I've posted an example above, with

  • 27in i7 iMac STILL won't install win7 64bit - I am using fix released 1/19

    Yes I know the new Bootcamp is out and I am following this guide word for word: http://support.apple.com/kb/HT3986 Just to be clear I want to install Windows 7 Professional 64-bit on a very new 27 inch i7 iMac. I ran software update to make sure I ha