Substr Function Help

Hi
I have string i/p say : '1.5/15 N60'
i am using functions to split it like this
SUBSTR(NVL('1.5/15 N60', '000'),
1,
instr('1.5/15 N60', '/') - 1) Ans:1.5
SUBSTR(NVL('1.5/15 N60', '000000'),
instr('1.5/15 N60', '/') + 1,
2) Ans:15
REPLACE(SUBSTR(NVL('1.5/15 N60', '000000000'), instr('1.5/15 N60', 'N')+1, 3),
'N',
'') Ans:60
so for an input '1.5/15 N60' it is spliting like this 1.5 15 and 60
but for an input '1.00/10 NET 30' it should split like this 1.00,10 and 30 but it is splitting it in to 1,00,10 and ET.
and for inputs '2.00/15 NET 75 TIERS' it should split has 2.00,15 and 75
For input like 'N60' the functions should split it in to 0,0 and 60
For input like '10 DAYS NO DISCOUNT' o/p should be 0,0 and 10
Thanks&Regards,

This function could fit you need. It outputs a collection.
CREATE OR REPLACE TYPE NUM_TABLE IS TABLE OF VARCHAR2(30)
CREATE OR REPLACE FUNCTION GET_NUMBERS(
     STRING IN VARCHAR2
RETURN NUM_TABLE
AS
     IDX INTEGER;
     I INTEGER;
     L INTEGER;
     S VARCHAR2(30);
     OUT_TAB NUM_TABLE;
BEGIN
     OUT_TAB := NUM_TABLE();
     I := 0;
     L := 0;
     IDX := 0;
     LOOP
          IDX := regexp_INSTR(string,'([0123456789])+(\.[0123456789])?',IDX+L+1);
          IF IDX = 0 THEN
               RETURN OUT_TAB;               
          END IF;
          OUT_TAB.EXTEND();
          I := I+1;
          S := regexp_SUBSTR(string,'([0123456789])+(\.[0123456789])?',IDX);
          L := LENGTH(S);
          OUT_TAB(I) := S;
     END LOOP;
END;
Processing ...
select *
from table (GET_NUMBERS('1.5/15 N60'))
Query finished, retrieving results...
         COLUMN_VALUE         
1.5                           
15                            
60                            
3 row(s) retrieved
Processing ...
select *
from table (GET_NUMBERS('10 DAYS NO DISCOUNT'))
Query finished, retrieving results...
         COLUMN_VALUE         
10                            
1 row(s) retrieved
Processing ...
select *
from table (GET_NUMBERS('NO NUMBERS'))
Query finished, retrieving results...
         COLUMN_VALUE         
0 row(s) retrievedBye Alessandro

Similar Messages

  • SubString Function Help

    Hello -
    I have the below string and need help with substring function.
    String: AMERICAS\JOHN_NOLAN
    1st Output Achieved: JOHN_NOLAN
    Code used for 1st Output:
    UPPER(SUBSTRING(ASSOC_NTWK_LOGIN,CHARINDEX('\',ASSOC_NTWK_LOGIN)+1,LEN(ASSOC_NTWK_LOGIN) - CHARINDEX('\',ASSOC_NTWK_LOGIN)))
    2nd Output Needed: AMERICAS (From the string)
    Please help.
    SS

    Hi,
    Please try below solution:
    CREATE TABLE #SUB
    ASSOC_NTWK_LOGIN VARCHAR(50)
    INSERT INTO #SUB(ASSOC_NTWK_LOGIN)
    VALUES
    ('AMERICAS\JONH_NOLAN');
    SELECT UPPER(SUBSTRING(ASSOC_NTWK_LOGIN,CHARINDEX('\',ASSOC_NTWK_LOGIN)+1,LEN(ASSOC_NTWK_LOGIN) - CHARINDEX('\',ASSOC_NTWK_LOGIN))) AS NAME
    ,UPPER(SUBSTRING(ASSOC_NTWK_LOGIN,0,CHARINDEX('\',ASSOC_NTWK_LOGIN))) AS LOGIN_NM
    FROM #SUB
    Regards,
    Reshma
    Please Vote as Helpful if an answer is helpful and/or Please mark Proposed as Answer or Mark As Answer when question is answered

  • Using substr function loses index. Query tune help

    Hi
    when i use substr function in the join condition it loses index and the query is slow. How to fix this problem or tune this query. These are the lines in the query.
    and substr(a.invoice_num,1,9) = l.invoice_num
    and substr(c.invoice_num,1,9) = mgr_apprv_lst.user_key
    and substr(c.invoice_num,1,9) = pbl_apprv_lst.user_key
    select
    pap.full_name employe_name,
         k.SEGMENT1 ||'.' ||k.segment2 Cost_Center,
         a.invoice_num Invoice_Number,
         b.item_description Line_Item,
         b.amount Amount,
         cc.trx_id Corporate_Card_Transaction_Id,
         cc.transaction_date Date_Charge_Incurred,
         cc.posted_date Date_Charge_Posted_To_USBank,
         cc.creation_date Date_Posted_To_IExpense,
         a.creation_date Expense_Report_Creation_Date,
         l.report_submitted_date Expense_Report_Submitted_Date,
         mgr_apprv_lst.activity_begin_date Managers_Approval_Begin_Date,
         mgr_apprv_lst.activity_end_date Managers_Approval_End_Date,
         pbl_apprv_lst.activity_begin_date AP_Approval_Begin_Date,
         pbl_apprv_lst.activity_end_date AP_Approval_End_Date,
         e.check_date Payment_Date_To_USBank,
         e.check_number Payment_Number,
         mgr_apprv_lst.activity_result_display_name Managers_Process_Result,
         pbl_apprv_lst.activity_result_display_name AP_Process_Result
    from
         ap_checks_all e,
         ap_invoice_payments_all d,
         ap_invoices_all c,
    ap_expense_report_headers_all a,
         ap_credit_card_trxns_all cc,
         per_all_people_f pap,
         ap_expense_report_headers_all l,
         ap_expense_report_lines_all b,
         gl_code_combinations k,
         (select ias1.user_key,
         ias1.activity_result_display_name,
         ias1.activity_begin_date,
         ias1.activity_end_date
    from wf_item_activity_statuses_v ias1,
    (select c1.invoice_num
         from ap_checks_all e1,
         ap_invoice_payments_all d1,
         ap_invoices_all c1
         where trunc(e1.check_date) between nvl(:From_Date, trunc(e1.check_date))
         and nvl(:To_Date, trunc(e1.check_date))
    and e1.org_id = 141
    and e1.void_date IS null
    and d1.check_id = e1.check_id
         and c1.invoice_id = d1.invoice_id) inv_lst1
    where ias1.item_type = 'APEXP'
    and ias1.user_key = inv_lst1.invoice_num
    and ias1.activity_name = 'AP_MANAGER_APPROVAL_PROCESS') mgr_apprv_lst,
    (select ias2.user_key,
         ias2.activity_result_display_name,
         ias2.activity_begin_date,
         ias2.activity_end_date
    from wf_item_activity_statuses_v ias2,
    (select c2.invoice_num
         from ap_checks_all e2,
         ap_invoice_payments_all d2,
         ap_invoices_all c2
         where trunc(e2.check_date) between nvl(:From_Date, trunc(e2.check_date))
         and nvl(:To_Date, trunc(e2.check_date))
    and e2.org_id = 141
    and e2.void_date IS null
    and d2.check_id = e2.check_id
         and c2.invoice_id = d2.invoice_id) inv_lst2
    where ias2.item_type = 'APEXP'
    and ias2.user_key = inv_lst2.invoice_num
    and ias2.activity_name = 'AP_PAYABLES_APPROVAL_PROCESS') pbl_apprv_lst
    where
    trunc(e.check_date) between nvl(:From_Date, trunc(e.check_date))
    and nvl(:To_Date, trunc(e.check_date))
    and e.org_id = 141
    and e.void_date IS null
    and d.check_id = e.check_id
    and c.invoice_id = d.invoice_id
    and a.invoice_num = c.invoice_num
    and a.source = 'CREDIT CARD'
    and a.employee_id = nvl(:Emp_id,a.employee_id)
    and a.report_header_id = b.report_header_id
    and cc.trx_id = b.credit_card_trx_id
    and pap.person_id = a.employee_id
    and pap.effective_start_date <= trunc(sysdate)
    and pap.effective_end_date >= trunc(sysdate)
    and k.code_combination_id = b.code_combination_id
    and k.segment2 between nvl(:From_Cost_Center,k.segment2)
    and nvl(:To_Cost_Center,k.segment2)
    and substr(a.invoice_num,1,9) = l.invoice_num
    and substr(c.invoice_num,1,9) = mgr_apprv_lst.user_key
    and substr(c.invoice_num,1,9) = pbl_apprv_lst.user_key

    Hi
    If I understood correctly your logic, and if the columns involved are of type varchar2, you can use the like operator:
    and a.invoice_num like l.invoice_num || '%'
    and c.invoice_num like mgr_apprv_lst.user_key  || '%'
    and c.invoice_num like pbl_apprv_lst.user_key  || '%'In this case, Oracle will be able to use the indexes. If they are numeric, you need to do something like:
    and a.invoice_num between l.invoice_num * 1000000
                                and l.invoice_num * 1000000 + 999999I hope this makes sense...
    Luis

  • Using substring function in the Universe

    What is the correct syntax of using the substring function in the Universe?
    I need to extract the numbers and decimal between the #'s, and the character length varies:
    From: DOE, JOHN  Added the following entry to work history:
    A1S#0.25#
    To: 0.25
    Please help!  Thanks!

    There are ticket details in the text - I replaced certain letters with x, o, or a.  I thought you would need the total number of characters in the text.
    0.25#"
    DOE, JOHN A Xddxd xxx xxllxwOIg xIxxI xx wxxk xOXxxxI:
    A1S#0.25#"O xxxxd Oxck xxxm CJ, xx XxOd xxxx wx xxx XuppxXxd xx Ox gxxxOIg xlxxxX xI xxOX.  Xx, xxx quxXxOxI xxmxOIX wxxx xx dx Ixw?  XOxxxx wx mxkx xxx dxcOXOxI xx OgIxxx xxOX cxIdOxOxI xId xxvx Ox xxmxvxd xxxm XmxxxX, xx wx xxI xx xxXxxxcx xxp xxlkxxX xId Xxx Ox wx cxI Xxxp Xxmx xx xxx xxxxxOc, xx wx xxdxx x OOggxx cOxcuOx xx xxIdlx xxx OuxXxX wOxxxux xII dxxpX.  O'll xxI xx xuI xxOX OI mxIxgxmxIx xId xxx xxXx xx xxx xxxm xx Xxx wxOcx wxI wx wxIx xx gx".
    1#"
    DXX, JXXN X XddXd xxX xxllxAxng XnxrN xx Axrk xxAxxrN:
    A1S#1#"X dxn'x AXX xxxA xn AxnAxrd.  X AxA gxxng xx AxXAk xxX xnxXrxxAX xx AXX xx ApxkXA xn xxrxugxpux AXrX xbAXrvXd xA xxA bXXn AuggXAxXd, xxAXvXr, xxA nxx xn AxnAxrd.  X AxXAkXd Dxrx xnd dxn'x AXX xnN xndxAxxxxn xxxx xxxA xA xn xnN xlxrI grxupA xxr xxrXAxxld Ixnxxxrxng, Ax X'I AxndXrxng AxXrX xxX xlxrI xA AxIxng xrxI.  Xx Axuld bX xxxx xxXrX xA nx xnxXnxxxn xx bX xlxrIxng xn xxxA xx xll xnd xxX xlxrIA Axuld bX AxIxng xrxI xn xld Ixnxxxrxng AxurAX xxxx xA nx lxngXr vxlxd (xX, xxxA AlxppXd xxrxugx xxX ArxAkA AxIXxxA).  X AXnx xn XIxxl xx AurxxA JxnXA xx AXX xx xX Axn xXll Axxx xxX AxurAX xx xxX xlxrI xA (xX, Axxx Ixnxxxrxng ANAxXI xAxuxllN gXnXrxxXd xxX xlxrI)."
    0.5#
    DOE, JOHN A Xaaxa xax OolloxixI xxxIx xo xoIk aisxoIx:
    A1S#.05# "XIxxsOxIIixI xo IXS XixI x quxux OoI xaaixioxxl ixOoIoxxiox xxa Ixcoooaxxioxs."

  • Substring Function without the length!

    I know I have seen this before, but cannot find it when searching.
    I need to do something similar to the Substring function, where I start from position 4, but the length behind this position is variable.   Due to the IDOC it only passes the value...
    I think I possibly saw a UDF for this somewhere - unless I can use some standard mapping!
    It is probably very simple - but it is late in the day and my eyes are square!  = )
    <i> I need a drink......</i>
    Can anyone help?
    Message was edited by:
            Barry Neaves

    For substring function, you have 1 input and 2 parameters (you set the parameters by double-clicking the function box).
    I also didn't understand how you can pass the output of length function two 2nd parameter of substring function (since it is a parameter and not an expected input).
    You could always create a UDF...
    public String UDSubstring(String a,String b,String c,Container container){
      int d = Integer.parseInt(b);
      int e = Integer.parseInt(c);
      if ((e == 0) && (a.length() >= d)) {
        return a.substring(d);
      else if ((e > d) && (a.length() >= e)) {
        return a.substring(d, e);
      else return "";
    They don't bite, you know...
    Regards,
    Henrique.
    <b>Edit:</b> followed by Michal's correction...

  • Substring Function in formula builder of transfer rule

    Hi Gurus
    I want to get the domain name from Email address.
    For eg: if the email address is [email protected], i want to display only "yahoo.com" in the report.
    For that, shall i use Substring function in transfer rule.
    If so, please advice me how i can do this.
    Thanks
    Sansen

    Instead try using a routine using the SPLIT function...
    For example if you want to split the value of the field TEST whose value is [email protected] then try writing a code like below in the transfer routine...
    DATA: TEST1(30), TEST2(30) TYPE C.
    SPLIT TRAN_STRUCTURE-ZEMAILID AT '@' into TEST1 and TEST2.
    RESULT = TEST2.
    (value of TEST2 would be yahoo.com)
    Hope this helps...

  • Substring function in DDL

    Can I use substring function in DDL? I want to get the prot_id column by combining rest of the columns. Please help me whether I can write like this or any way is there?
    create table testsyn(
    lega_sty_nr          VARCHAR2(6),
    col_cd VARCHAR2(6),
    del_cd VARCHAR2(2),
    prot_id VARCHAR2(60) as
    (select SUBSTR(
    CASE WHEN(LENGTH(lega_sty_nr) > 0)
         THEN lega_sty_nr||'_'||col_cd||'_'||del_cd
    ELSE NULL
    END )
    )

    No.
    +(inspired by Alex ;) )+
    edit:
    You need to explain more clearly what you're trying to do.
    Why the substr?
    SQL> create table testsyn(
      2  lega_sty_nr VARCHAR2(6),
      3  col_cd VARCHAR2(6),
      4  del_cd VARCHAR2(2),
      5  prot_id VARCHAR2(60) as
      6  (select SUBSTR(
      7  CASE WHEN(LENGTH(lega_sty_nr) > 0)
      8  THEN lega_sty_nr||'_'||col_cd||'_'||del_cd
      9  ELSE NULL
    10  END )
    11  );
    prot_id VARCHAR2(60) as
    ERROR at line 5:
    ORA-00907: missing right parenthesisEdited by: hoek on Jun 10, 2009 11:56 AM

  • UCCX Script String Substring Function

    I cannot use the Substring function to obtain a specific value from a string variable.
    My substring position is variable, so I need to put a variable, loop and increment it the position.
    When I try to add the below command, this is getting the error message:
    Command: set STR_Resultado = STR_Valor.substring(P1,2+1)
    Error message:
    "Unable to parse expression; error while parsing string: STR_Valor.substring(P1,P2); nested exception is java.lang.NullPointerException"

    To ask the obvious: do either P1 or STR_Valor have a null value at the time that step executes? If they do, this is the expected result. Use an On Exception Goto step or other preventative code to protect the step from this exception.
    Why does your command and the error not match?
    Command: substring(P1,2+1)
    Exception: substring(P1,P2)
    If the command statement is what you're actually using (your image attachment isn't showing) then I believe you have a syntax error. The substring method documentation doesn't suggest you can do additive operations here.
    Most likely the first bullet though...
    PS- You may want to get the length of the string first and ensure that the startIndex and endIndex are less than or equal to it. I believe you'll get a IndexOutOfBoundsException if you try to pull a substring from outside the bounds of the actual string.
    Please remember to rate helpful responses and identify helpful or correct answers.

  • ABAP Substring function from right side

    Hi,
    I want a substring function in ABAP, which starts from right instead of left to display some character out of a complete string.
    Suppose there is a variable zdatavar -
    zdatavar = 'MyNameIsBush'.
    zdatavar = zdatavar+4(2).
    The above will start from the left.
    I want some function which start from the right.
    Your help will be greately appreciated.
    Regards,
    SC

    Hi,
    Please check if this is working.
    REPORT  Z0804.
    DATA str TYPE STRING.
    DATA str2 TYPE STRING.
    str = 'MyNameIsBush'.
    WRITE: / str.
    PERFORM rsubstring
        USING
            str
            2
        CHANGING
            str2
    WRITE: / str2.
    FORM rsubstring
        USING
            str TYPE STRING
            len
        CHANGING
            out TYPE STRING
        DATA:
            strln TYPE i,
            l_offset TYPE i,
            l_len TYPE i
        strln = STRLEN( str ).
        if strln GE len.
        l_offset = strln - len.
        l_len = len.
        out = str+l_offset(l_len).
        endif.
    ENDFORM.
    result:
    MyNameIsBush
    sh
    regards,
    Xiang Li

  • Use of substr function will avoid the use of indexes in a table

    i have one table which will contain some 3,00,000 records, it contains some 11 primary keys i am using some update statements to update some fields in the records (of 3,00,000 i will compare some 1,50,000 records with 1,50,000 another records) i am using substr function in all the select statements. whether usage of substr function will avoid the use of index
    can any one clarify?

    contains some 11 primary keys by this I suppose you mean to say the table has a composite PK on 11 columns.
    i am using substr function in all the select statementsCould you please post your SQL statement?

  • SUBSTR function in the where clause

    HI
    I want to get a number of 15 digits from a column where the user only know the last 10 digits.
    So that when the user enter a number with 10 digits, only the record of that specific number should be displayed.
    And then when the user did not enter any number all the records in the table should be displayed.(this part works fine)
    The problem is: when the user enters any last digits( last, second last, thirth last and so on) the records which satisfy this are retrieved, which is not supose to be the case.
    I' am trying to use the substr function in the where clause but I'm not sure if it's working or not becasue the result of the query is just the same as before i used the substr.
    Thanks

    better to pad with '*' me thinks in case u have a number ending with 0's:
      1  select empno,ename
      2  from emp
      3* where empno like '%'||lpad('&1',2,'*')
    SQL> /
    Enter value for 1: 0
    old   3: where empno like '%'||lpad('&1',2,'*')
    new   3: where empno like '%'||lpad('0',2,'*')
    no rows selected
    SQL> /
    Enter value for 1: 00
    old   3: where empno like '%'||lpad('&1',2,'*')
    new   3: where empno like '%'||lpad('00',2,'*')
         EMPNO ENAME
          7900 JAMES
    SQL> /
    Enter value for 1:
    old   3: where empno like '%'||lpad('&1',2,'*')
    new   3: where empno like '%'||lpad('',2,'*')
         EMPNO ENAME
          7369 SMITH
          7499 ALLEN
          7521 WARD
          7566 JONES
          7654 MARTIN
          7698 BLAKE
          7782 CLARK
          7788 SCOTT
          7839 KING
          7844 TURNER
          7876 ADAMS
         EMPNO ENAME
          7900 JAMES
          7902 FORD
          7934 MILLER
    14 rows selected.

  • Substr function? extracting just the records with 4 digits?

    have a column like this in a table
    SZSCAPD_SEC_SCHOOL_CEEB
    364775
    460460
    460240
    2562
    164625
    460240
    230969I need to be able to retrieve just the values with 4 digits like 2562 and add 00 at the front, so it will ended like 002562
    I am thinking in the substr function, but it won't work, because I will be extracting the first 4 digits of each number.
    How I will do this? I want to only retrieve the numbers with 4 digits Then I will concatenate the 00 in front.
    Thank you

    Hi,
    peace4all wrote:
    ... How I will do this? I want to only retrieve the numbers with 4 digits One way to do that is
    WHERE   TRANSLATE ( szscapd_sec_school_ceeb
                , '123456789'
                , '000000000'
                ) = '0000'
    Then I will concatenate the 00 in front.
    '00' || szscapd_sec_school_ceebThis assumes that szscapd_sec_school_ceeb is a string.
    If szscapd_sec_school_ceeb is a positive number, and you want to ignore any fractional part, use
    WHERE   szscapd_sec_school_ceeb     >=  1000
    AND     szscapd_sec_school_ceeb <  10000to find the numbers and
    TO_CHAR (szscapd_sec_school_ceeb, 'FM000000')to display them as 6 digits, with leading 0's.
    Edited by: Frank Kulash on Aug 20, 2010 11:01 AM
    Added NUMBER alternative.

  • SQL function help

    Hi, I am trying to write a sql query to replace the string starting with '<' with NULL. Right now I am using CASE statement to replace with NULLs. Is there any function to replace with NULLs for all the strings starting with '<%'.
    Example:
    CASE When field_name LIKE '<%' then NULL else field_name
    (before) After
    <NA> NULL
    <UK> NULL
    I want to replace the above sql suery with a single sql function without using CASE statements.
    I tried to use REPLACE function, but it replaces only single character. I want to replace the whole string
    Thanks in advance.

    Hi,
    Adam Martin posted a good solution. I hope that it is clear to you that you have to replace the string '<NA>' with your column(s).
    I.e.:
    SELECT REGEXP_REPLACE (a.col1, '^<.?+', '') AS col1
         , REGEXP_REPLACE (a.col2, '^<.?+', '') AS col2
      FROM table1 a;
    {code}
    You can use also the DECODE and SUBSTR functions to have the same result:
    The code below will get the first character with SUBSTR function and the DECODE function will return NULL if the value of the first character is "<" otherwise the value of the column.
    {code:sql}
    SELECT DECODE(SUBSTR(a.col1,1,1),'<', NULL, a.col1) AS col1
         , DECODE(SUBSTR(a.col2,1,1),'<', NULL, a.col2) AS col2
      FROM table1 a;
    {code}
    but using REGEXP_REPLACE is easier to write.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Substring function not working in Analytical view

    Dear All,
    I am trying to use substring function in my analytical view .It says valid expression during syntax check but getting activation error.
    thanks
    Sourav

    Hi Krishna,
    This is Kiran, I am trying to restrict a (string) filed value by removing the spaces and wring to calculated column field in an Analytical view for position 6 - 10.
    Example: Field name XYZ (Values showing as: ASDFG GETVALUENW  2345) --> (data type :22 VARCHAR)
    Output Value must be : GETVALUENW (which is 10 characters, from position 6 after trimming)
    Please advice which function use and how to apply the syntax
    Your inputs are highly appreciated.
    Thanks
    Kiran.

  • Substring function in HFR

    Hello Experts,
    Iam a rookie in HFR. I needed to know how to implement the Substring functionality in Hyperion. Can anyone throw some light on this?

    thats a major drawback of hyperion financial reporting of not having any string functions. as per my knowledge there is none.
    Let me know if you get to know of the same. Coz even I need it for couple of things in my reports.
    regards,
    rahul

Maybe you are looking for

  • Problem in passing url

    Hi Everyone, I have a issue in my application. I would be glad if any could help me with this. I have a couple of parameters on my main page which the user can select and then click on the link below to open a report filtering on the basis of the par

  • How can I reduce the amount of space taken up by "other" on my phone?

    In iTunes my iPhone (4s) shows up with 2.81 gb designated "other."  I'd really REALLY like to use this space for other things and want to get rid of the "other."  I've read a lot of posts about restoring your phone (which I did) and I also tried dele

  • Parallel port sample rate

    Hi, I`m desperately in need of your help. For my school project, I`m trying to write a labview code in order to acquire air pressure data by using 8-bit analog digital converter via parallel port. Although my signal frequency very low -100 Hz-I think

  • Can't see or recognize my external drive?

    I've installed OSX 10.3.9 on top of a completely updated 9.2.2 and the OSX is working fine. The internal hard drive was partitioned into 6 or 7 different drives when I was using 9.2. I loaded 10.3.9 onto one of the partitions and it recognizes all of

  • Hi,my iPad 64GB is not turning on,what do i do to fix it

    Hi,I have an Apple iPad 64GB and since monday its not coming on,what do i do to fix it,Please help. Thank You