Divide by Zero

Hi,
I didn't look too far in the books but.... Divide by zero return an error, wich is mathematically correct but visually give me headache....
Is there an easy solution to avoid it.
I'd like to except this error from being displayed with a red triangle and not the other errors.
I dont like to type complicated formulas for treating such an error.
Thanks

You could check to see of the result of the function is an error, then substitute "".
Example:
=IF(A2=0,"",B2/A2)
Regards,

Similar Messages

  • SSRS Expression divide by zero error

    Hi, I am getting an error in SSRS calculating the field that potentially divide by zero. may i ask your help to fix this issue. thanks.
    =First(Fields!CEQ_all.Value, "DailyUpdates_DS") = value is zero
    =Sum(Fields!Prod_Plan_Yield.Value, "DailyUpdates_DS")= value is 0.16
    --This is the codes in my field expression
    =IIF(First(Fields!CEQ_all.Value, "DailyUpdates_DS")>Sum(Fields!Prod_Plan_Yield.Value, "DailyUpdates_DS"),Sum(Fields!Prod_Plan_Yield.Value, "DailyUpdates_DS")/First(Fields!CEQ_all.Value, "DailyUpdates_DS"),1)

    try like this
    =IIF(First(Fields!CEQ_all.Value, "DailyUpdates_DS")>Sum(Fields!Prod_Plan_Yield.Value, "DailyUpdates_DS"),Sum(Fields!Prod_Plan_Yield.Value, "DailyUpdates_DS")/IIF(First(Fields!CEQ_all.Value, "DailyUpdates_DS")>0,First(Fields!CEQ_all.Value, "DailyUpdates_DS"),Nothing),1)
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Attempted to divide by zero. Error while executing the script

    Hi All,
    I using a script I found long back and I'm trying to use to get disk space info from different servers with separate credentials.
    I'm getting the below error and it has eaten my head but I'm not able to figure out where the problem lies in the code.
    Attempted to divide by zero.
    At D:\psscripts\ww.ps1:92 char:26
    + $freePercent = ($frspace/ <<<< $totSpace)*100
    + CategoryInfo : NotSpecified: (:) [], RuntimeException
    + FullyQualifiedErrorId : RuntimeException
    I'm open to use any other way to find me Disk Space with different credentials..here security isn't a question.
    This script uses computers.csv to reference the computer name and the referenced credentials in the script.
    Thanks in advance
    $freeSpaceFileName = "c:\script\FreeSpace.htm"
    $warning = 50
    $critical = 30
    New-Item -ItemType file $freeSpaceFileName -Force
    $ComputerList = Import-Csv -Path d:\Computers.csv;
    $CredentialList = @{
    Cred1 = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList 'laptop-pc\administrator', (ConvertTo-SecureString -String 'tamboli' -AsPlainText -Force);
    Cred2 = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList 'contoso\administrator', (ConvertTo-SecureString -String 'Atlantic12' -AsPlainText -Force);
    Function writeHtmlHeader
    param($fileName)
    $date = ( get-date ).ToString('dd/MM/yyyy HH:mm:ss')
    Add-Content $fileName "<html>"
    Add-Content $fileName "<head>"
    Add-Content $fileName "<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>"
    Add-Content $fileName '<meta http-equiv="refresh" CONTENT="5">'
    Add-Content $fileName '<title>All Servers DiskSpace Report&copy;</title>'
    add-content $fileName '<STYLE TYPE="text/css">'
    add-content $fileName "<!--"
    add-content $fileName "td {"
    add-content $fileName "font-family: Tahoma;"
    add-content $fileName "font-size: 20px;"
    add-content $fileName "border-top: 1px solid #999999;"
    add-content $fileName "border-right: 1px solid #999999;"
    add-content $fileName "border-bottom: 1px solid #999999;"
    add-content $fileName "border-left: 1px solid #999999;"
    add-content $fileName "padding-top: 0px;"
    add-content $fileName "padding-right: 0px;"
    add-content $fileName "padding-bottom: 0px;"
    add-content $fileName "padding-left: 0px;"
    add-content $fileName "}"
    add-content $fileName "body {"
    add-content $fileName "margin-left: 5px;"
    add-content $fileName "margin-top: 5px;"
    add-content $fileName "margin-right: 0px;"
    add-content $fileName "margin-bottom: 10px;"
    add-content $fileName ""
    add-content $fileName "table {"
    add-content $fileName "border: thin solid #000000;"
    add-content $fileName "}"
    add-content $fileName "-->"
    add-content $fileName "</style>"
    Add-Content $fileName "</head>"
    Add-Content $fileName "<body>"
    add-content $fileName "<br></br>"
    add-content $fileName "<table width='100%' align=center>"
    add-content $fileName "<tr bgcolor='#CCCCCC'>"
    add-content $fileName "<td colspan='7' height='25' align='center'>"
    add-content $fileName "<font face='tahoma' color='#003399' size='5'><strong>All Servers DiskSpace Report &copy; - $date</strong></font>"
    add-content $fileName "</td>"
    add-content $fileName "</tr>"
    add-content $fileName "</table>"
    add-content $fileName "<br></br>"
    # Function to write the HTML Header to the file
    Function writeTableHeader
    param($fileName)
    Add-Content $fileName "<tr bgcolor=#CCCCCC>"
    Add-Content $fileName "<td width='10%' align='center'>Drive</td>"
    Add-Content $fileName "<td width='50%' align='center'>Drive Label</td>"
    Add-Content $fileName "<td width='10%' align='center'>Total Capacity(GB)</td>"
    Add-Content $fileName "<td width='10%' align='center'>Used Capacity(GB)</td>"
    Add-Content $fileName "<td width='10%' align='center'>Free Space(GB)</td>"
    Add-Content $fileName "<td width='10%' align='center'>Freespace %</td>"
    Add-Content $fileName "</tr>"
    Function writeHtmlFooter
    param($fileName)
    Add-Content $fileName "</body>"
    Add-Content $fileName "</html>"
    Function writeDiskInfo
    param($fileName,$devId,$volName,$frSpace,$totSpace)
    $totSpace=[math]::Round(($totSpace/1073741824),2)
    $frSpace=[Math]::Round(($frSpace/1073741824),2)
    $usedSpace = $totSpace - $frspace
    $usedSpace=[Math]::Round($usedSpace,2)
    $freePercent = ($frspace/$totSpace)*100
    $freePercent = [Math]::Round($freePercent,0)
    if ($freePercent -gt $warning)
    Add-Content $fileName "<tr>"
    Add-Content $fileName "<td>$devid</td>"
    Add-Content $fileName "<td>$volName</td>"
    Add-Content $fileName "<td>$totSpace</td>"
    Add-Content $fileName "<td>$usedSpace</td>"
    Add-Content $fileName "<td>$frSpace</td>"
    Add-Content $fileName "<td>$freePercent</td>"
    Add-Content $fileName "</tr>"
    elseif ($freePercent -le $critical)
    Add-Content $fileName "<tr>"
    Add-Content $fileName "<td>$devid</td>"
    Add-Content $fileName "<td>$volName</td>"
    Add-Content $fileName "<td>$totSpace</td>"
    Add-Content $fileName "<td>$usedSpace</td>"
    Add-Content $fileName "<td>$frSpace</td>"
    Add-Content $fileName "<td bgcolor='#FF0000' align=center>$freePercent</td>"
    #<td bgcolor='#FF0000' align=center>
    Add-Content $fileName "</tr>"
    else
    Add-Content $fileName "<tr>"
    Add-Content $fileName "<td>$devid</td>"
    Add-Content $fileName "<td>$volName</td>"
    Add-Content $fileName "<td>$totSpace</td>"
    Add-Content $fileName "<td>$usedSpace</td>"
    Add-Content $fileName "<td>$frSpace</td>"
    Add-Content $fileName "<td bgcolor='#FBB917' align=center>$freePercent</td>"
    # #FBB917
    Add-Content $fileName "</tr>"
    foreach ($computer in $ComputerList)
    Get-WmiObject -ComputerName $Computer.Name -Class Win32_LogicalDisk -Credential $CredentialList[$Computer.Credential] | Where-Object {$_.drivetype -eq 3}
    Write-Host $item.DeviceID $item.VolumeName $item.FreeSpace $item.Size
    writeDiskInfo $freeSpaceFileName $item.DeviceID $item.VolumeName $item.FreeSpace $item.Size
    writeHtmlHeader $freeSpaceFileName
    foreach($computer.Name in Get-Content Computers.csv)
    Add-Content $freeSpaceFileName "<table width='100%'><tbody>"
    Add-Content $freeSpaceFileName "<tr bgcolor='#CCCCCC'>"
    Add-Content $freeSpaceFileName "<td width='100%' align='center' colSpan=6><font face='tahoma' color='#003399' size='2'><strong> $server</strong></font></td>"
    Add-Content $freeSpaceFileName "</tr>"
    Add-Content $freeSpaceFileName "<br>"
    writeTableHeader $freeSpaceFileName
    Thanks,

    Hi Taher,
    You got the error "Attempted to divide by zero.", because the input variable $totSpace is null, please note the variable $item when you invoked the function writeDiskInfo:
    >>Get-WmiObject -ComputerName $Computer.Name -Class Win32_LogicalDisk -Credential $CredentialList[$Computer.Credential] |  Where-Object {$_.drivetype -eq 3}
    >>Write-Host  $item.DeviceID  $item.VolumeName $item.FreeSpace $item.Size
    >>writeDiskInfo $freeSpaceFileName $item.DeviceID $item.VolumeName $item.FreeSpace $item.Size
    And you haven't defined the variable $item before you used it, so please refer to the script below:
    foreach ($computer in $ComputerList)
    $items = Get-WmiObject -ComputerName $Computer.Name -Class Win32_LogicalDisk -Credential $CredentialList[$Computer.Credential] | Where-Object {$_.drivetype -eq 3}
    foreach($item in $items){
    Write-Host $item.DeviceID $item.VolumeName $item.FreeSpace $item.Size
    writeDiskInfo $freeSpaceFileName $item.DeviceID $item.VolumeName $item.FreeSpace $item.Size}
    If there is anything else regarding this issue, please feel free to post back.
    Best Regards,
    Anna Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Smartform convert to PDF dump - divide by zero

    SAP Version 4.7 Enterprise
    hello all,
    i am trying to do somethign rather basic that is discussed in these forums many times: convert Samrtforms output to PDF. i used the suggested forms but came across a unique (i think) error. my problem is that when i run the CONVERT_OTF_2_PDF function i get a core dump with the error "divide by zero". reading the core dump i see that there appears to be a font issue in the form:
    Code: Select all
    055610   * non-proportional font                                                
    055620   * if charwidth is not equal the default PostScript charwidth,          
    055630   * print string with individual character positioning                   
    055640   * WARNING: The unit used with PDFs (..) xx TJ command for individual   
    055650   * char positioning is 1 EM = 1/1000 fontsize!!!                        
    055660   * ofs_em = 1000 * (charwidth / fontsize_twip)                          
    055670   * WARNING: ...TJ moves current point to the LEFT of character          
    055680                                                                          
    055690   * set word spacing = 0                                                 
    055700     PERFORM PDF_APPEND_STREAM USING '0 Tw'. "#EC NOTEXT                  
    055710     IF CHARWIDTH < FONTINFO-DEF_SPACEWIDTH.                              
    055780   *   a positive value moves charpos to the LEFT!                        
    055790     ELSE.                                                                
    055800   *   OTF character spacing is wider than PostScript default             
    >       OFFSET_EM = 1000 * ( CHARWIDTH - FONTINFO-DEF_SPACEWIDTH )         
    055820                   / FONTINFO-FONTSIZE_TW.                                
    055830       PERFORM PDF_REM_LEAD_ZEROES_I USING 5 OFFSET_EM COORD.             
    055840   *   a negative value moves charpos to the RIGHT!                       
    needless to say this works perfectly when printing to paper. i am not using any non-stnadard fonts. the fonts are Arial with sizes of 6, 8, 10 and 12. any ideas? FYI, the code to call the functions is below. cheers,
    james
    Code: Select all
      CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
        EXPORTING
          i_language             = sy-langu
          i_application          = 'SAPDEFAULT'
        IMPORTING
          e_devtype              = dev_typ
        EXCEPTIONS
          no_language            = 1
          language_not_installed = 2
          no_devtype_found       = 3
          system_error           = 4
          OTHERS                 = 5.
      ctrl_params-no_dialog = 'X'.
      ctrl_params-getotf = 'X'.
      out_opt-tdnewid = 'X'.
      out_opt-xsfcmode = 'X'.
      out_opt-xsf = ' '.
      out_opt-xdfcmode = 'X'.
      out_opt-xdf = ' '.
      out_opt-tdprinter = dev_typ.
      CALL FUNCTION fm_name
        EXPORTING
          control_parameters         = ctrl_params
        IMPORTING
          job_output_info            = job_info
        TABLES
          i_outtab                   = i_output
          i_header                   = i_header
        EXCEPTIONS
          formatting_error           = 1
          internal_error             = 2
          send_error                 = 3
          user_canceled              = 4
          others                     = 5.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      p_otf[] = job_info-otfdata.
      CALL FUNCTION 'CONVERT_OTF_2_PDF'
        IMPORTING
          bin_filesize                 = l_bin_filesize
        TABLES
          otf                          = p_otf[]
          doctab_archive               = p_doctab[]
          lines                        = p_lines[]
        EXCEPTIONS
          err_conv_not_possible        = 1
          err_otf_mc_noendmarker       = 2
          others                       = 3.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

    SAP Version 4.7 Enterprise
    hello all,
    i am trying to do somethign rather basic that is discussed in these forums many times: convert Samrtforms output to PDF. i used the suggested forms but came across a unique (i think) error. my problem is that when i run the CONVERT_OTF_2_PDF function i get a core dump with the error "divide by zero". reading the core dump i see that there appears to be a font issue in the form:
    Code: Select all
    055610   * non-proportional font                                                
    055620   * if charwidth is not equal the default PostScript charwidth,          
    055630   * print string with individual character positioning                   
    055640   * WARNING: The unit used with PDFs (..) xx TJ command for individual   
    055650   * char positioning is 1 EM = 1/1000 fontsize!!!                        
    055660   * ofs_em = 1000 * (charwidth / fontsize_twip)                          
    055670   * WARNING: ...TJ moves current point to the LEFT of character          
    055680                                                                          
    055690   * set word spacing = 0                                                 
    055700     PERFORM PDF_APPEND_STREAM USING '0 Tw'. "#EC NOTEXT                  
    055710     IF CHARWIDTH < FONTINFO-DEF_SPACEWIDTH.                              
    055780   *   a positive value moves charpos to the LEFT!                        
    055790     ELSE.                                                                
    055800   *   OTF character spacing is wider than PostScript default             
    >       OFFSET_EM = 1000 * ( CHARWIDTH - FONTINFO-DEF_SPACEWIDTH )         
    055820                   / FONTINFO-FONTSIZE_TW.                                
    055830       PERFORM PDF_REM_LEAD_ZEROES_I USING 5 OFFSET_EM COORD.             
    055840   *   a negative value moves charpos to the RIGHT!                       
    needless to say this works perfectly when printing to paper. i am not using any non-stnadard fonts. the fonts are Arial with sizes of 6, 8, 10 and 12. any ideas? FYI, the code to call the functions is below. cheers,
    james
    Code: Select all
      CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
        EXPORTING
          i_language             = sy-langu
          i_application          = 'SAPDEFAULT'
        IMPORTING
          e_devtype              = dev_typ
        EXCEPTIONS
          no_language            = 1
          language_not_installed = 2
          no_devtype_found       = 3
          system_error           = 4
          OTHERS                 = 5.
      ctrl_params-no_dialog = 'X'.
      ctrl_params-getotf = 'X'.
      out_opt-tdnewid = 'X'.
      out_opt-xsfcmode = 'X'.
      out_opt-xsf = ' '.
      out_opt-xdfcmode = 'X'.
      out_opt-xdf = ' '.
      out_opt-tdprinter = dev_typ.
      CALL FUNCTION fm_name
        EXPORTING
          control_parameters         = ctrl_params
        IMPORTING
          job_output_info            = job_info
        TABLES
          i_outtab                   = i_output
          i_header                   = i_header
        EXCEPTIONS
          formatting_error           = 1
          internal_error             = 2
          send_error                 = 3
          user_canceled              = 4
          others                     = 5.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      p_otf[] = job_info-otfdata.
      CALL FUNCTION 'CONVERT_OTF_2_PDF'
        IMPORTING
          bin_filesize                 = l_bin_filesize
        TABLES
          otf                          = p_otf[]
          doctab_archive               = p_doctab[]
          lines                        = p_lines[]
        EXCEPTIONS
          err_conv_not_possible        = 1
          err_otf_mc_noendmarker       = 2
          others                       = 3.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

  • Divide by zero error encountered

    Dear All,
    When our customer process PO, they got an error like below:
    Divide by zero error encountered. Tax definition [ovcg]
    They also got Divide by zero error encountered. Outgoing payments  [ovpm]
    They can process their business but we need to know why and how to fix this error for them.
    Any idea? Thanks.
    Regards,
    Yuka

    Hi,
    You need to check the FMS defined on the row level of the document you want to add.
    Remove the FMS and you will not get the error message reported.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

  • This Query IS giving divide by zero error when executed in sql plus

    UPDATE grn G
    SET g.OPT_WA_FAIR_VAL_A = (SELECT
    ROUND(SUM(NVL(ga.OPT_FAIR_VAL_A, 0) * NVL(gvs.GRN_VEST_OPT_Q, 0)) / SUM(NVL(gvs.GRN_VEST_OPT_Q, 0)), 6)
    FROM
    GRANT_VESTING_SCHEDULE gvs,
    GRANT_ASSUMPTION ga
    WHERE
    gvs.ORG_GRP_I = ga.ORG_GRP_I AND
    gvs.grn_n = ga.grn_n AND
    ga.ORG_GRP_I = g.ORG_GRP_I AND
    ga.GRN_N = g.GRN_N AND
    NVL(ga.GRN_ASMPN_EFF_D, gvs.grn_vest_d) <= gvs.grn_vest_d AND
    NVL(ga.GRN_ASMPN_END_D, gvs.grn_vest_d) >= gvs.grn_vest_d
    WHERE G.ORG_GRP_I =5
    Any suggestions

    hi
    What should be result if divide by zero e.g
    SQL> SELECT * FROM emp;
        EMPNO ENAME        JOB             MGR HIREDATE        SAL      COMM    DEPTNO
         7901 SMITH        CLERK          7902 17-DEC-80         0         0        20
         7499 ALLEN        SALESMAN       7698 20-FEB-81      2100      1800        30
         7521 WARD         SALESMAN       7698 22-FEB-81      2300      2000        30
         7566 JONES        MANAGER        7839 02-APR-81      1000      3000        20
         7654 MARTIN       SALESMAN       7698 28-SEP-81      3200       700        30
         7698 BLAKE        MANAGER        7839 01-MAY-81      1000      3000        30
         7782 CLARK        MANAGER        7839 09-JUN-81      1000      3000        10
         7788 SCOTT        ANALYST        7566 19-APR-87      1000      1900        20
         7839 KING         PRESIDENT           17-NOV-81      1000      1700        10
         7844 TURNER       SALESMAN       7698 08-SEP-81      1800       700        30
         7876 ADAMS        CLERK          7788 23-MAY-87      1000      1300        20
         7900 JAMES        MANAGER        7698 03-DEC-81      1000      3000        30
         7902 FORD         ANALYST        7566 03-DEC-81      1000      2000        20
    13 rows selected.
    SQL> SELECT sal/DECODE(comm,0,1,comm) FROM emp;
    SAL/DECODE(COMM,0,1,COMM)
                            0
                    1.1666667
                         1.15
                    .33333333
                    4.5714286
                    .33333333
                    .33333333
                    .52631579
                    .58823529
                    2.5714286
                    .76923077
                    .33333333
                           .5
    13 rows selected.Khurram

  • I would like to be able to use in my formula zero divided by zero (which is zero).  I need this in order for my P

    I would like to expand briefly on my submitted question.  I developed a spread sheet to monitor profit and loss on stocks that I trade.  My P & L column currently displays the negative value of my purchase(s).  I created a formula that includes my exit price of the stock which is zero until I sell some shares.  I would like my P & L column to show a correct value and then of course total the column.  I was able to create a formula that is mathematically correct using a variable divided by itself to give me a correct display but Numbers wouldn't allow it because sometimes that variable is equal to zero until I sell some shares of the stock and then the sell price gets plugged in.  If that variable is any number besides zero then obviously the formula will be multiplying by one (1) and that will show me a correct value in my P & L column.  Any suggestions or ideas?  Please advise.  Thanks carjam.

    0 / 0 is not defined.  It is NOT equal to zero.  it is a special case which you should avoid.  If you have questions about the details of dividing by zero refer to here:
    http://en.wikipedia.org/wiki/Zero_divided_by_zero
    you may want to perform the divide only if the dividend is not zero or maks the error using the function iferror()
    something like:
    =iferror(A1/B1, 0)
    this will attempt to divide A1 by B1 and return the result.  if there is an error then the function will return zero

  • Ora-07445: Integer Divide by zero

    hi all,
    i have this error in my alert log.
    ORA-07445: exception encountered: core dump [skgxpdmpctx()+343] [SIGFPE] [Integer divide by zero] [0x4001BFFF
    when this error occur many times the db went down, what's this error about? have you experience this before..
    pls guide me or give me some precedures in detail on how to resolved this error.
    DB:
    Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
    PL/SQL Release 9.2.0.7.0 - Production
    CORE 9.2.0.7.0 Production
    TNS for Linux: Version 9.2.0.7.0 - Production
    NLSRTL Version 9.2.0.7.0 - Production
    OS:
    Red Hat Linux Advanced Server release 2.1AS/\m (Pensacola)
    thanks in advanced,

    It's bug, and fixed in 9.2.0.7
    ALERT: ORA-7445 SKGXPDMPCTX Instance Crash Possible After Applying 9.2.0.5 or 9.2.0.6 Patchset
    Bug 4059639 - ORA-7445 SKGXPDMPCTX Instance Crash with 9.2.0.5 or 9.2.0.6 Patchset
    Possible Symptoms
    ~~~~~~~~~~~~~~~~~
    Instance failure and a message similar to the following in the alert log:
    ORA-07445: exception encountered: core dump [skgxpdmpctx()+183] [SIGFPE]
    [Integer divide by zero] [0x4001BE3F] [] []
    Workaround
    ~~~~~~~~~~
    Run in single instance mode or apply the fixes.
    Enter to metalink.oracle.com and enter to this url:
    http://updates.oracle.com/ARULink/PatchDetails/process_form?patch_num=4059639
    Download 76Kb patch (Patch 4059639 )
    You need p4059639_9206_LINUX.zip file

  • Divided by zero error

    All,
    I am having trouble with one of the reports in EBS.
    When I run the two underlying sql of the report in toad I get the data.
    But, when I ran the report from the application I was getting some oracle error.
    So, I ran the report directly from the reports builder to see what error I am getting.
    It turns out that I am getting divided by zero error.
    I am passing in the org id and gl dates an inputs the report.
    Please help me debug the report.

    Could you check if your report has any subquery that doesn't return any record when the parameters are submitted at run time.
    I had the issue in Crystal Reports where it threw a divide by 0 error.

  • Catching errors such as divide by zero and typing non-numeric characters

    Fellows: How do I extend following script to catch errors such as divide by zero and typing non-numeric characters.      Thanks
    This program takes two integers (whole numbers), then displays the sum, average, division,
    Modula of those numbers and finally the first number raised to the power of the second number.
    import java.io.*;
    public class HWOne
         public static void main(String[] args) throws IOException  // error handling
              // variable declaration
              String firstdigit, seconddigit;
              int first, second, sum, total, modus, power;
              float division;
              double average;
              BufferedReader myIn = new BufferedReader(new InputStreamReader(System.in));
              //Invoke user response
              System.out.print("Please enter first digit ");
                   firstdigit = myIn.readLine();
                   first = Integer.parseInt(firstdigit);
              System.out.print("Please enter second digit ");
                   seconddigit = myIn.readLine();
                   second = Integer.parseInt(seconddigit);
              //computations
              sum = first + second;
              average = (double)sum / (double)2;
              division = (float)first / (float)second;
              modus = first % second;
              power = (int)Math.pow(first, second);
              //Screen message
              System.out.println("Sum: " + sum);
              System.out.println("Average: " + average);
              System.out.println("Division: " + division);
              System.out.println("Modula: " + modus);
              System.out.println("Power: " + power);

    Have you learnt about try/catch statements yet?
    The parseInt method throws a NumberFormatException. So you place the call to that method inside a try statement and catch the exception.
    For divide by zero, you can use an if statement. If the divisor != 0 perform division.

  • SQL to avoid Dreaded "Divide by Zero" error

    Hey,
    I have been banging my head off the decode and NVL functions to avoid the divide by zero error, can tfor the life of me get it.
    2 columns, a & b.
    Need to get: a/b (but the whole thing fails if either is null or zero)
    Any help greatly appreciated.
    Dob

    VG2 wrote:
    You need something like
    decode( b, 0, to_number(null),
    b, null, to_number(null),
    a/b )What is that?
    in psuedo language with that statement you are saying...
    If b is zero then return to_number(null) (which is the same as null) else
    if b is null then to_number(null) (which is still null) else
    a/b
    surely it's just a case of saying
    nvl(a,0)/nvl(b,1)which assumes that if b is null it should not effect a and if a is null then the result should be zero.

  • Divide by Zero encountered 'Withholding Tax'

    Good evening pro's
    I'm busy with a test upgrade to 8.8 SP00 PL14 and everything went successful, but in 8.8 when i open a sales order, i get an error message that says Divide by zero error encountered 'Withholding Tax'
    I put in the with holding tax in under financial setup and then the message disappears.  when i close sales orders and open it again, the message is back... how can i get rid of this message?
    I forgot to mention that this doesn't block to order / delivery / invoice to be processed at all.
    Thanks in advance,
    Reinhardt
    Edited by: R. Buytendorp on Oct 25, 2010 6:54 PM

    Hi Kate,
    Yes i've managed to sort out the problem.  One of our formatted searches was causing the issue.
    We have a formatted search on one of our fields that calculate an addition to the unit prices depending on what value (Value between 0 and 10) is chosen.
    The 0 in the field was causing this error to pop up as it was the default value for the field, so all i did was to edit the formatted search with a CASE WHEN <calculation> = 0 then 0 else <calculation>.
    The error does not pop up anymore.
    I hope this will help you...
    Reinhardt

  • Arithmetic Overflow/Underflow and Divide by Zero Errors

    We're having problems similar to those posted below (see links), especially "Help: Divide by Zero Errors" to which no one has addressed. <br /><br />Here's our situation: On our form, we have two columns that sum the rows above them, called<br /><br />"covertotal" and "multtotal"<br /><br />...for which we need a final calculation: multtotal/covertotal<br /><br />Under calcutions in FormCalc, we have generated the following formula for the box called "prevtotal" under the calculate command: <br /><br />(multtotal / covertotal)<br /><br />However, since this calculation runs when the document is opened, we get a divide by zero error. Do we need to create an initialize or calculate formula to correct for this zero? If so, what is the proper coding.<br /><br />Please spell this out, we're that stupid... <sigh><br /><br />Thanks!<br /><br />Matthew<br /><br />Previous posts with similar problems are linked below:<br /><br />Help: Divide by Zero Errors<br /><a href="/cgi-bin/webx?14@@.3bbd2077">Harry Kontos, "Help: Divide by Zero Errors" #, 6 Nov 2005 10:01 pm</a><br /><br />calculations overflow/underflow<br />http://www.adobeforums.com/cgi-bin/webx/.3bbeb7e0<br /><br />FormCalc error-arithmetic overflow/underflow<br />http://www.adobeforums.com/cgi-bin/webx/.3bbc15f3

    Your error message indicates your script is being executed as FormCalc, not JavaScript.
    If you're using FormCalc try using an If statment to test for zero/null.
    if (tr>0) then (ac/tr)*100 endif

  • At startup-system error and divide by zero

    I've been having a lot of problems starting up my beige G3 mini tower, it has 233mhz, 384ram, mac os9.1. I've zapped the pram and held the shift key down to boot with extensions off, didnt work. I've changed the battery twice in case the first replacement was bad, it started up and ran long enough for me to trash all the preferences, I tried to change the extensions, but when restarting it was back to not completely starting up. I've tried pressing the button near the pci slots with the battery out, 30 seconds, waited 30 minutes and held down the button for another 30 seconds, replaced the battery, checked the sound card for looseness then at startup it worked till I changed the time and date. I tried the battery and button again this time waiting over night between pressing the button for 30 seconds, after startup I was able to run disc first aid and it said everything was ok, then crashed again when I tried to change the date and time. I've even tried booting up from command/option/o/f, I'm not sure what firmware is but it would try to start up that way,but was very slow with a os cd in the cd drive. I tried to erase the hard drive but I couldnt get it to start up from a cd, iv'e tried os9, the original cd that came with the computer and a system recovery cd.
    Most times when trying to start it up it chimes, then the happy mac with a grey screen, then the mac os screen, then the bomb with "system error" and under that "bus error" under that it says to restart with extensions off. sometimes the button for restart will even work with the cursor. Once, after trying to start up after all the battery removal, pressing button near pci slots , pressing com/opt/o/f, extensions off, the screen getting to the mac os then the bomb dialogue, it said system error and instead of saying "bus error" it said "divide by zero". Thats the first and only time I've seen that one. Also, the grey screen (with the happy mac disc icon) now has horizontal lines with texture? that I havent noticed before.
    got any ideas what I should do next? I probably wouldnt bother with my G3 anymore because I just bought a new Imac, but I have a vinyl cutter hooked to it, it has the old round serial port cables and I would have to buy new software, cables and dongle to use it with my new Imac, I also have illustrator, photoshop, scanner, and drawing tablet on my G3 that I cant use on my new Imac (intel) leopard.
    Is my hard drive or motherboard dying? is there a way to find out if and what hardware is messed up? and if so, is there still still parts out there for this G3?

    Hi, R1camper -
    I ran disc first aid from the cd and and it said it couldnt fix-overlapped extent allocation,4,479.
    That is a type of disk directory damage, one which Disk First Aid can not repair.
    Alsoft's DiskWarrior can usually repair that kind of damage, with no loss of files. If you choose to go this route, suggest you call (or email) Alsoft's sales department, and request an older version of DiskWarrior - the current versions won't run on your Beige G3/MT.
    However, if you can manage to live with the loss of files, you can probably replace the hard drive for less cost.
    Your Beige G3/MT came with either an ATA (now often referred to as PATA and/or IDE) drive or a SCSI drive - it could have been ordered with either when the machine was new.
    With luck it will be an ATA drive, since those are the least expensive and the easiest to install. Such drives are not Mac-specific - any ATA drive designed for internal use and of appropriate size will work. The only item of concern is to set the drive's jumpers properly. The drive should be jumpered as Master (it may come preset as Master or as Cable Select - Cable Select will not work on your model), unless it is a Western Digital in which case it should be set to Single if that is an available choice.
    There is probably little to gain by getting a 7200RPM drive, especially if there is extra cost for one vs. a 5400RPM drive - the relatively slow internal bus speed on your machine will not be able to take significant advantage of a faster drive.
    Re the RAM, if you have the time you might try replacing any you took out. Over time the contact the module makes in its slot can get iffy - removing and replacing the module usually fixes that problem, by wiping the contacts clean.

  • Update Rules : Divide by zero error

    Hi All,
    I am calculating Condition Rate for billing using formula KWERT/FKIMG i.e. amount/quantity. Its giving me divide by zero error when FKIMG = 0.
    Can we prevent division by 0 error like we can do it in query formula uding NDIV0.
    Thanks
    PB

    Hi,
    you can write routine to avoid the error.
    if quantity <> 0.
      conditon rate = amount /quantity
    else
      conditon rate = space or zero (according to your requirement)
    endif.
    Message was edited by:
            Siva Chidambaram

  • Help: Divide by Zero Errors

    Hi, can someone please advise me on how to avoid script failure alerts (like the one below), which are generated because certain calculations are being performed before any positive value has yet been set in a numeric field?
    Here is an example of the calculation:
    --- form1.SF_CalculationTable.acview[0]::calculate - (FormCalc, client) --
    (ac[0] / tr[0]) * 100
    Error example:
    Script failed (language is formcalc; context is
    xfa[0].form[0].form1[0].SF_CalculationTable[0].acview[0])
    script=(ac[0] / tr[0]) * 100
    Error: arithmetic over/underflow.
    update: it appears these erros are "divide by zero" errors.
    So my questions are,
    (1) would I put any javascript (to override the zeros) on the "validate" event or the "calculate" event, and on which of the three fields in question, acview[0] (the result), tr[0] (the denominator) or ac[0] (the numerator). and...
    (2) What might that javascript look like?
    Harry

    Your error message indicates your script is being executed as FormCalc, not JavaScript.
    If you're using FormCalc try using an If statment to test for zero/null.
    if (tr>0) then (ac/tr)*100 endif

Maybe you are looking for

  • Detaching audio converts to mono

    hi. my video clip has stereo audio. it plays fine until i detach the audio, then for some reason imovie 09 converts it to left channel/mono. i know i can stick it in garageband and double up the track to make it seem like sterero, but... why does thi

  • How to post Special G/L ?

    Hi SD Experts, When i try to do a posting, system prompts error saying that this specific account is marked as a reconciliation account for account type "D" and cannot therefore be directly posted to. How can i post this specific special G/L accounti

  • Swapping the charactersitcs in query

    Hi, I've a query in the following format Company Code   Material Group  Ker Figure1 KeyFigure 2 1000                    AB                   3000          40000 2000                    AB                   5000          60000 3000                   

  • Home hub connected but can't open web pages

    Hi Having a problem accessing any web pages. Has been like this for last 3 days. All the lights on the BT Home Hub are on and according to the task bar on my laptop it is connected and signal etc is all fine. When you open browser it tries to connect

  • Common Dialog Box Tool - No ActiveX showing up in list of tools

    Hi people, I've just been upgraded to Office 360 ProPlus which includes Excel 2013.  An Excel file that I made a couple years back that utilized the Common Dialog Control has worked through Excel 2007 but my new Excel 2013 no longer recognizes the ob