SUM in Oracle 7.3.3.0.0

Hello everyone
Version Oracle 7.3.3.0.0 Developer 6i
I have following values...
Bill# Amount
2376 1693
2354 11813
2342 2694
2313 13055
2273 1860
I want to get the sum(amount) of only those bills whose sum is less then
or equal to 25000.
Result should be...
Bill# Amount
2342 2964
2313 13055
2273 1860
I want to get the above result using the above version of oracle only.
Please help me to solve this problem.
Thanks
Rehan

Hi,
must confess - I cannot follow your example.
Do you mean the SUM() SQL function ?
And why is bill #2273 shown and not bill#2354? and all amounts are less than 25000, so you should get all as a result set.
Can you explain a bit better ?
Cheers,
Udo
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Rehan Ata ([email protected]):
Hello everyone
Version Oracle 7.3.3.0.0 Developer 6i
I have following values...
Bill# Amount
2376 1693
2354 11813
2342 2694
2313 13055
2273 1860
I want to get the sum(amount) of only those bills whose sum is less then
or equal to 25000.
Result should be...
Bill# Amount
2342 2964
2313 13055
2273 1860
I want to get the above result using the above version of oracle only.
Please help me to solve this problem.
Thanks
Rehan<HR></BLOCKQUOTE>
null

Similar Messages

  • Doubling Summed Numbers from Temp Table

    I have a crystal report that uses an Oracle Stored Procedure. The stored procedure sums (using Oracle sum function) some of the data from another table into a temp table, does some additional data manipulation and then selects from the temp table. My problem is any of the data that was summed in the stored procedure is displaying as double in the Crystal Report, (e.g. a field that sums to 10 is displaying as 20 in the Crystal Report.) When I run this Stored Procedure from Oracle SQL Developer I get the correct data.
    Could anyone tell me why this is happening and what to do to correct they problem? I am using Version 11.0.0.1282 of Crystal and Oracle 10g.
    Thanks,
    Debbie

    Hi Debbie,
    You also did not mention which DB driver you are using, ODBC, OLE DB or our native Oracle driver. Try one of the other ones to see they work. Could be an issue in the specific driver you are using.
    Testing in Oracle will use the native client engine. Try using a third party SQL, ODBC or OLE DB test tool to verify running the SP works.
    Thanks again
    Don

  • Help with math / calculations in RTF templates

    Greetings,
    I know that there are math capabilities in the templates... I've seen the code samples in the Core Components guide.
    What this doesn't tell you is WHERE these things would go in a template. And... that... is my question.
    We are just starting to use BIP in conjunction with JDE EnterpriseOne (8.12, tool set 8.97.12). For our first attempt we're creating our template over a new report.
    I have a template where I sum two different repeating values (through the normal BI Properties) and place these values in two separate cells in a table. I want to sum the two of these together for a "grand" total.
    I've seen the "examples" but they really aren't very helpful. The xsfo, etc. for doing addition is fine, but WHAT are the values to add and WHERE does the code go?
    If anyone has done something like this or has experience using the embedded code I would appreciate hearing from you.
    Thanks in advance

    I see what you are saying about the spaces... but it made no difference... still got the error.
    The XML file is too large and convoluted to be pasted here.
    With reqards to the following snippet:
    COLA = <?sum(current-group()/COLA)?>
    COLB = <?sum(current-group()/COLB)?>
    Summ== <?sum(current-group()/COLA) + sum(current-group()/COLB)?>
    Where does THIS code go?
    Here is the error detail:
    ConfFile: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\config\xdoconfig.xml
    Font Dir: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    Template: C:\Documents and Settings\jdenison\My Documents\BIP Templates\R5642001\R5642001_TEMPLsave.rtf
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\Documents and Settings\jdenison\My Documents\BIP Templates\R5642001\R5642001_RICE0001_D081029_T144059683.xml
    FOProcessor setLocale: en-us
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
         at RTF2PDF.runRTFto(RTF2PDF.java:629)
         at RTF2PDF.runXDO(RTF2PDF.java:439)
         at RTF2PDF.main(RTF2PDF.java:289)
    Caused by: oracle.xdo.parser.v2.XPathException: Extension function error: Method not found 'sum'
         at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1534)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:521)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:489)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:271)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:155)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:192)
         ... 15 more

  • Depreciation Expense For Related Project Assets

    Dear All,
    I have a question, Please help.
    How can I post depreciation expense from Oracle Asset to Oracle Project Costing for assets that working and assigned to Projects like equipments and Cars that assigned to project..... and we want to post their deprecation expense as burden in oracle project costing ????
    ++Please find the below my search conclusion in past few days.++
    1- Oracle Say that "There is currently no interface between Oracle Assets and Oracle Projects which allows you to post depreciation expenses directly to projects."
    2- I have non-complete idea: I have a project Segment in AFF so I can Post depreciation expense for related project assets to GL directly, with Project segment value and create Expenditure Batch in Oracle costing to manually enter depreciation expense as lump-sum in Oracle costing but it is not preferred to create Entries in Subledger Accounting and not send it to GL so my question in this work-around, Can I Create Expenditure Batch and only create Distributions 'PRC: Distribute Labor Costs' ???
    And don't create rest steps "PRC: Generate Cost Accounting Events,PRC: Create Accounting, PRC: Transfer Journal Entries to GL"
    Please suggest best solution or help me in my work-around, its urgent
    Thanks in Advance
    I Orouk

    Kindly find the below case as example ---
    There are 5 equipment like trucks and cars that working in project X100 so I want to show depreciation expense for the mentioned assets as Burden on the X100 Project in Oracle Project Costing Module..
    Please Consider the below focal points:
    1- Regarding Oracle Assets business Cycles. Oracle Assets send depreciation expense to GL directly and there is no any impact in Oracle Project Costing about Depreciation expense(for Project related assets )
    2- Project X100
    Project Cost = 10000 $
    Depreciation Expense for the 5 equipment (Project related assets) = 1000 $
    Real Project cost = Project Cost 10000 + Depreciation Expense for the 5 equipment 1000 = 11000 $
    I want to show Real Project cost in Costing Module so I have to record Assets Depreciation Expense for the Project related assets in Oracle Project Costing .... Can you help me about what the best way to record Assets Depreciation Expense for the Project related assets in Oracle Project Costing and please review my suggestion about expenditure batch in 1st post
    Thanks in Advance
    Iorouk
    Edited by: user12255659 on Jan 23, 2012 12:56 PM

  • Case Sensitivity Issue with Latin Characters

    Hi,
    The Latin Character that i am talking abt is "i",
    I am trying to provide in my application the support for Azeri-Latin(Turkish family) Characters,
    That is the display and the orientation of characters is perfectly fine throughout the flow of application.
    But now there is a problem when selecting a data from DB using like constraint in where clause... The issue has been elaborated below...
    From the set of characters there are two character in which i am facing Case Sensitivity issue...
    They are as,
    i ---> the capital of same is ---> İ
    ı ---> the capital of same is ---> I
    now in english character mapping,
    for i ---> the capital is ---> I
    So, this is creating an issue...
    Now the test i have done is as follows,
    I created a table as,
    Create Table CS
    CS1 VARCHAR2(20)
    Following is the data that is inserted in the table,
    Insert into CS values('İ');
    Insert into CS values('i');
    Insert into CS values('I');
    Insert into CS values('ı');
    now i am running the following query,
    Select * from CS where lower(CS1) like lower('%&a%');
    for characters "i","İ","I" it returns 3 rows, that are,
    i
    İ
    I
    and for character ı it only returns,
    ı
    ideally for characters "i" & "İ" should be mapped with each other and "ı" & "I" should be mapped with each other respectively.
    But that is not the case.
    I am using Oracle 10g
    my NLS_database_parameters are as follows,
    PARAMETER     VALUE
    NLS_LANGUAGE     AMERICAN
    NLS_TERRITORY     AMERICA
    NLS_CURRENCY     $
    NLS_ISO_CURRENCY     AMERICA
    NLS_NUMERIC_CHARACTERS     .,
    NLS_CHARACTERSET     AL32UTF8
    NLS_CALENDAR     GREGORIAN
    NLS_DATE_FORMAT     DD-MON-RR
    NLS_DATE_LANGUAGE     AMERICAN
    NLS_SORT     BINARY
    NLS_TIME_FORMAT     HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT     DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT     HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT     DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY     $
    NLS_COMP     BINARY
    NLS_LENGTH_SEMANTICS     BYTE
    NLS_NCHAR_CONV_EXCP     FALSE
    NLS_NCHAR_CHARACTERSET     AL16UTF16
    NLS_RDBMS_VERSION     10.2.0.1.0
    and at client i m using,
    NLS_LANG = .AL32UTF8
    any help on this issue will be appreciated,
    Thanks & Regards,
    Pratik

    I'm not fully understand your question but I guess you may need to set up NLS_LANGUAGE, NLS_TERRITORY db parameters and client NLS_LANG.
    eg client NLS_LANG=TURKISH_AZERBAIJAN.AL32UTF8 and db parameters NLS_LANGUAGE=TURKISH, NLS_TERRITORY=AZERBAIJAN
    Full list of supported languages, locales see [Oracle® Database Globalization Support Guide local data subpage|http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/applocaledata.htm]
    or tip2: check this: ALTER SESSION SET NLS_COMP=LINGUISTIC;
    Edited by: Kecskemethy on Mar 24, 2009 3:14 AM
    or you need something like this:
    Example 5-16 Matching with the Base Letter Operator [==]
    Expression: r[[=e=]]sum[[=e=]]
    Matches:
    resume<<
    résumé<<
    résume<<
    resumé<<Oracle SQL syntax: SQL> SELECT col FROM test WHERE REGEXP_LIKE(col,'r[[=e=]]sum[[=e=]]');Edited by: Kecskemethy on Mar 24, 2009 3:20 AM

  • Solution manager 7.1 - Entering upgrade-phase "MAIN_SHDIMP/SUBMOD_SHDIMP/SHADOW_IMPORT_INC" taking long hours

    Hello,
    phase "MAIN_SHDIMP/SUBMOD_SHDIMP/SHADOW_IMPORT_INC" looks like hanged. I tried restarting the SAP SUM and oracle but it get stopped at same stage. There is no log generating neither any change in tmp file for almost 10 hours.
    Changed the Shadow system memory according to 1387739
    set the Oracle initialization parameter " _use_zero_copy_io=false"
    ULOG
    ### Phase MAIN_SHDIMP/SUBMOD_SHDIMP/SHADOW_IMPORT_INC:
    soladm       20140511004744    : H:\usr\sap\SOL\SUM\abap\exe\tp.EXE pf=H:\usr\sap\SOL\SUM\abap\var\DEFAULT.TPP setstopmark buffer=SOL before SAPK-707BZINBICONT  (pid=584)
    soladm       20140511004745    : H:\usr\sap\SOL\SUM\abap\exe\tp.EXE pf=H:\usr\sap\SOL\SUM\abap\var\SHDALLIMP.TPP put SOL -Dmainimp_proc=1 -Dparallel=3  (pid=1076)
    SHDALLIMP
    SHADOW IMPORT ERRORS and RETURN CODE in SAPKB70210.SOL
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    4 ETW000  [    dbtrtab ,00000]  ***LOG BY4=>sql error 3113   performing SEL on table TRBAT3                       
    4 ETW000                                                                                                  65  28272.089379
    4 ETW000  [    dbtrtab ,00000]  ***LOG BY0=>ORA-03113: end-of-file on communication channel               37  28272.089416
    4 ETW000                        Process ID: 7936
    4 ETW000                        Session ID: 239 Serial number: 47
    2EETW000 sap_dext called with msgnr "1":
    According toNote  1597414 I need to create TRBAT3 in source system , ie my main system. Is it ok to create now or do I need to restart  Phase after the creating or do I need to start the SUM from scratch ?
    Regards,
    Raghu

    Hi Vikram,
    Sorry it was my mistake , I have set the parameter wrongly. Set it properly and it starts working.
    Your note were relevant and useful. 
    Thanks,
    Raghu

  • Connect by/Analytical problem

    I'm using Oracle 9i and have problem like below.
    I have a table like this: header_part, component_part, qty
    where component_part is child of header_part and qty is number of component parts.
    One component part could consist of zero or more other component parts, i.e. a tree structure.
    The same component can exist in one or many branches of the same tree.
    Example:
    header_part, component_part, qty
    a b 2
    a c 1
    b d 1
    b e 2
    c d 2
    c f 1
    d g 1
    Result:
    component_part, tot_qty
    b 2
    c 1
    d 4
    e 4
    f 1
    g 4
    What I like to do is to calculate the total qty for each component part for a given header part.
    Is this possible in a singel query? How could I do this?

    Why not just CONNECT BY and SUM?
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> VARIABLE header_part VARCHAR2 (1);
    SQL> EXEC :header_part := 'a';
    PL/SQL procedure successfully completed.
    SQL> SELECT :header_part, component_part, qty
      2  FROM    table_name
      3  START WITH header_part = :header_part
      4  CONNECT BY header_part = PRIOR component_part;
    :HEADER_PART                     C        QTY
    a                                b          2
    a                                d          1
    a                                g          1
    a                                e          2
    a                                c          1
    a                                d          2
    a                                g          1
    a                                f          1
    8 rows selected.
    SQL> SELECT  :header_part, component_part, SUM (qty) total_qty
      2  FROM    table_name
      3  START WITH header_part = :header_part
      4  CONNECT BY header_part = PRIOR component_part
      5  GROUP BY   :header_part, component_part;
    :HEADER_PART                     C  TOTAL_QTY
    a                                f          1
    a                                d          3
    a                                g          2
    a                                b          2
    a                                e          2
    a                                c          1
    6 rows selected.
    SQL>

  • Help using oracle syntax "SUM(col1) over (order by col2)" using ODI

    Hi all
    I want to load data from oracle to ESSBASE using ODI, and I know oracle have such syntax sum(col1) over (order by col2,col3) which can get the accumulation data, e.g
    Oracle data table
    col1, col2, value
    A 2009-1 10
    A 2009-2 10
    A 2009-3 10
    And the essbase need
    col1 col2 value
    A 2009-1 10
    A 2009-2 20
    A 2009-3 30
    However after i try this in ODI, error occur:
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 32, in ?
    java.sql.SQLException: ORA-00979: not a GROUP BY expression
    and the original generated SQl by ODI :
    select 'HSP_InputValue' "HSP_Rates",MAP_KMDZ_TABLE.BUD_DYKM "Account",MAP_MONTH.ESS_MONTH "Period",MAP_YEAR.ESS_YEAR "Year",'Actual' "Scenario",'Draft' "Version",TEMP_LIRUN.CURRENCY "Currency",MAP_COMPANYCODE.ESS_COMPCODE "Entity",substr(MAP_KMDZ_TABLE.BUD_BUSINESSOBJECT,1,80) "BusinessObject",'Route_NoRoute' "Route",MAP_TRANSPORT.ESS_TRANSPORT "Transport",substr(MAP_KMDZ_TABLE.BUD_BUSINESSACTIVITY,1,80) "BusinessActivity",substr(MAP_KMDZ_TABLE.BUD_CHANNEL,1,80) "Source",'NoCounterparty' "Counterparty",sum(TEMP_LIRUN.DATAVALUE) over (order by MAP_KMDZ_TABLE.BUD_DYKM,MAP_YEAR.ESS_YEAR,MAP_MONTH.ESS_MONTH,TEMP_LIRUN.CURRENCY,MAP_COMPANYCODE.ESS_COMPCODE,MAP_TRANSPORT.ESS_TRANSPORT,MAP_KMDZ_TABLE.BUD_BUSINESSACTIVITY,MAP_KMDZ_TABLE.BUD_BUSINESSOBJECT,MAP_KMDZ_TABLE.BUD_CHANNEL) "Data" from ETL_DEV.TEMP_LIRUN TEMP_LIRUN, ETL_DEV.MAP_KMDZ_TABLE MAP_KMDZ_TABLE, ETL_DEV.MAP_MONTH MAP_MONTH, ETL_DEV.MAP_YEAR MAP_YEAR, ETL_DEV.MAP_COMPANYCODE MAP_COMPANYCODE, ETL_DEV.MAP_TRANSPORT MAP_TRANSPORT where      (1=1) And (TEMP_LIRUN.COSTELMNT=MAP_KMDZ_TABLE.SAP_ZZKM)
    AND (TEMP_LIRUN.FISCYEAR=MAP_YEAR.SAP_YEAR)
    AND (TEMP_LIRUN.FISCPER3=MAP_MONTH.SAP_MONTH)
    AND (TEMP_LIRUN.COMP_CODE=MAP_COMPANYCODE.SAP_COMPCODE)
    AND (TEMP_LIRUN.WWHC=MAP_TRANSPORT.SAP_WWHC) Group By MAP_KMDZ_TABLE.BUD_DYKM,
    MAP_MONTH.ESS_MONTH,
    MAP_YEAR.ESS_YEAR,
    TEMP_LIRUN.CURRENCY,
    MAP_COMPANYCODE.ESS_COMPCODE,
    substr(MAP_KMDZ_TABLE.BUD_BUSINESSOBJECT,1,80),
    MAP_TRANSPORT.ESS_TRANSPORT,
    substr(MAP_KMDZ_TABLE.BUD_BUSINESSACTIVITY,1,80),
    substr(MAP_KMDZ_TABLE.BUD_CHANNEL,1,80)
    I know ODI think sum.. over must append group by , however it's not! How to solve this problem.
    Thank All for your attention
    SOS!
    Ethan

    Hi Ethan,
    In my exeprnc I faced a similar kind of situation.
    Two work arounds.
    1. Write one procedure and execute the same using ODI procedure.
    2. Customize a Km and use that KM in your interface.
    I guess in your query Group by function is not needed. (if this is the case you can achive this by a smple customization step in KM)
    for example : your current KM will generate a query like this:-
    select x,y, sum(x) over (order by y) as sumx FROM TestTable group by x, y
    and you need a query like this
    select x,y, sum(x) over (order by y) as sumx FROM TestTable
    go to your KM (duplicate the KM which you are using and rename _withoutGroup )
    remove the group by function from select query
    (remove the API function <%=snpRef.getGrpBy()%> from insert into i$ table step)
    please let me know if you need more help on this
    regards,
    Rathish

  • Sum function do not work in oracle reports enhanced spreadsheet format

    we are using oracle reports 10.1.2.3 in our oracle application server 10gr2 and we are creating enhanced spreed sheet.And the report opens in MS excel fine.But we can not apply any formula like VALUE,SUM,AVG on that report after opening it into excel.First we thought that it may be because of the comma in the number filed.we removed that comma from the filed but t still gives the error "Error in value"

    Hi,
    I hope you already solved this problem, I had the same issue after spending an hour I found the workaround, this is just for the guys who experience the same issue. Try to format your number columns either at database level(not via Report builder property palette) with TO_CHAR(...) OR use this Format Mask at Report level to format your numbers -NNNGNNNGNN0D000(negative sign must be there to avoid space in output Excel).
    Hope it helps,
    Regards,
    Syed Khawar

  • Using a Sum query in Oracle Forms

    Greedings,
    I have the following query which works fine in PL/SQL but i cant get it working in Oracle forms as i get an error in SUM(SELECT...) . Any quidance on how i should fix my query to work in Forms?
    select
       Sum((SELECT kl.amount
                FROM S03_a_salfldg@oracle_to_sun kl
                WHERE Trim(kl.accnt_code)=Trim(a.acnt_code)
                AND kl.period between 2008001 AND 2008012 AND ROWNUM=1)) AS actual
       from so_budgets_cat a,a01_acnt@oracle_to_sun b,so_budgets_com c,so_budgets d
       where trim(a.acnt_code)=trim(b.acnt_code)
       AND a.cat=c.cat
       AND TRIM(d.acnt_code)=trim(a.acnt_code)
       AND d.business_object=10000103883
       AND d.business_object=c.bus_object
       AND d.business_object=a.business_object
       AND SubStr(d.period,1,4)=Trim(c.PERIOD_Y)
       AND C.period_Y BETWEEN substr(2008001,1,4) AND substr(2008001,1,4)
       GROUP BY a.cat,a.acnt_code,c.com,a.cat_desc,b.descr,d.acnt_code
       order by a.cat,a.acnt_code,c.com,a.cat_desc,b.descrThanks in advance

    And what error would that be? Also where are you using this query? In a from clause query? Also you didn't specify any version infos; as forms has it's own PL/SQL engine there is a possibility that you run in a version problem if the code runs fine in SQL*Plus but fails to compile in forms (e.g. when running Forms 6i against a 10g database). Without those informations answers to your question are based on guessings, and most likely will result in a question-answer ping-pong.
    cheers

  • Need sum help..........Regarding Oracle Procedure Builder

    hi,
    i wnt sum information abt oracle procedure builder.
    i m preparing for 1zo-047,n wnt oracle procedure builder 2 practice.
    cn ne1 plssssssssssss tel me whr shd i luk 4 it....
    i cd nt found dis s/z newhr on internet,i even dnt knw whether i hv 2 download it from internet or its already present in the sql plus.
    cn ne1 pls help me 2 resolve these queries.... its urgent....
    thnx in advance

    908759 wrote:
    its urgent....It is urgent that you learn some language skills.
    If you cannot express yourself with clarity and evidence of intelligence, then you will never get anywhere in life.
    It actually hurt my head to try to understand whatever you typed into that post.

  • Oracle 9i Sum() Rounding Error?

    Has anyone encountered problems with the Sum() function rounding the results?
    Here is the situation and results that I'm observing:
    We are Priming a new accounting system in preparation for beta testing. This data priming involves importing a number of bank transactions into the database. To verify that the import was 100% successful, after each batch I query the table to see what the total amount and number of transactions that were imported.
    For one bank account, the total amount that should have been imported was: $65,954,194.99 spread over 2771 transactions. After running the following query, Oracle reported the total as being $65,954,195.00".
    SELECT BANK_ACCOUNT_ID, SUM(TOTAL_AMOUNT), COUNT(BANK_TRANS_ID)
    FROM BANK_TRANSACTIONS
    GROUP BY BANK_ACCOUNT_ID;
    The field TOTAL_AMOUNT is NUMBER(28,2).
    After importing all of the bank accounts, I ran another overall sum of the total_amount field for the entire table. The result of that sum were rounded off to the nearest whole dollar as well.
    I also went back and performed several small sum actions by filtering the result set to roughly groups of 500 transactions and then manually adding those results together and did come up with the correct total amount.
    Running the summing sql statement on smaller accounts with fewer transactions (less than 1000) returned accurate data. However all of the larger accounts had this rounding problem.
    Any help or suggestions on how to correct this?
    Thanks.

    Ignore this message. I feel like a total idiot now. :-(
    The problem wasn't with the sum() function, but instead with SQL*Plus.

  • Problem in Oracle Discoverer  Getting Sum for a column

    HI! All,
    I am using oracle discoverer, while calculating totals for a particular column, the sum does not appear for multiple row, where as it appears for 1 row,
    invoice number itemdescription amount
    1001 ABC 20
    DEF 30
    GHI 40
    SUM:(NOTHING DISPLAYED)
    1002 DEF 190
    SUM:190
    CAN ANY 1 PLEASE HELP IN THIS MATTER?
    Regards
    ritesh Khuller

    can you post the complete SQL statements? thanks.

  • Oracle 11g SUM function on the result of inner Select

    The inner Select returns rows with the values. The outer select running on tthe result of inner select SUM the result of the inner select.
    Although there are valid rows of the inner select the SUM in the outer SELECT return NVL. As a comment any aggregate function on the outer select returns NVL.
    The query is below.
    select a.yil,
    a.ay,
    sum(brut_prim),
    sum(kom),
    from (SELECT oid_pol_kesilen_acente,
    to_char(pp.zeyil_tanzim_tar, 'yyyy') yil,
    to_char(pp.zeyil_tanzim_tar, 'mm') ay,
    sum(decode(substr(pp.no, 1, 1),
    'T',
    pp.zeyil_brut_prim_fark / 2,
    pp.zeyil_brut_prim_fark)) -
    sum(pp.zeyil_gv_fark) brut_prim,
    sum(pp.zeyil_acente_kom_fark) kom
    from pol_police pp, org_acente oa
    WHERE SUBSTR(PP.NO, 1, 1) != 'D')
    group by oid_pol_kesilen_acente,
    to_char(pp.zeyil_tanzim_tar, 'yyyy'),
    to_char(pp.zeyil_tanzim_tar, 'mm')) a
    group by a.yil, a.ay, oid_pol_kesilen_acente
    Edited by: [email protected] on May 7, 2010 2:09 AM
    Edited by: [email protected] on May 7, 2010 2:31 AM

    Hi,
    please try the below sql:
    select a.yil, a.ay, sum(brut_prim), sum(kom),
    from (SELECT oid_pol_kesilen_acente,to_char(pp.zeyil_tanzim_tar, 'yyyy') yil, to_char(pp.zeyil_tanzim_tar, 'mm') ay,
    sum(decode(substr(pp.no, 1, 1), 'T',nvl(pp.zeyil_brut_prim_fark,0) / 2,nvl(pp.zeyil_brut_prim_fark,0))) - sum(nvl(pp.zeyil_gv_fark,0)) brut_prim,
    sum(nvl(pp.zeyil_acente_kom_fark,0)) kom
    from pol_police pp, org_acente oa
    WHERE SUBSTR(PP.NO, 1, 1) != 'D'
    group by oid_pol_kesilen_acente,
    to_char(pp.zeyil_tanzim_tar, 'yyyy'),
    to_char(pp.zeyil_tanzim_tar, 'mm')
    ) a
    group by a.yil, a.ay, oid_pol_kesilen_acente ;
    Thanks,
    Siva

  • How to sum hours which is varchar2 data type in oracle

    Hi My table is like this
    emp_ngtshthrs (empno number(10),nightshifthrs varchar2(20));
    now I want sum employee nightshifthrs how to do sum of hrs, this is my hours data 01:00,05:00,08:00,10:00,07:00 and 09:00
    I want sum the varchar2 type of hours how to do it? and I want to display even the sum is more than 24:00 hrs

    Well, first you have posted your question in the wrong forum. You should have posted your question in the PL/SQL forum.
    The second problem I see is that you are being too generic when you have your employees enter their night shift hours worked. If you are able, I recommend you modify your table to record hours seperately from minutes and make the columns of type NUMBER instead of type VARCHAR2(). Then you can use simply arithmatic to total the hours and minutes worked.
    If you are locked into your table and can't change it, then you can convert the characters to numbers and then perform your summary arithmatic on the values. For example:
      1  with tab1 as (
      2  select 10 as empno, '01:00' as nightshifthrs from dual union all
      3  select 10 as empno, '05:00' as nightshifthrs from dual union all
      4  select 10 as empno, '08:00' as nightshifthrs from dual union all
      5  select 10 as empno, '10:00' as nightshifthrs from dual union all
      6  select 10 as empno, '07:00' as nightshifthrs from dual union all
      7  select 10 as empno, '09:00' as nightshifthrs from dual)
      8  select sum(to_number(replace(nightshifthrs,':','.'))) AS hours_worked
      9* from tab1
    SQL> /
    HOURS_WORKED
              40
    SQL> Of course, if your users can and do enter minutes, then that complicates the example I provided. You will have to convert the minutes to decimal, sum the amount, then convert the decimal back to time and add this to your hours. For example:
      1  with tab1 as (
      2  select 10 as empno, '01:15' as nightshifthrs from dual union all
      3  select 10 as empno, '05:00' as nightshifthrs from dual union all
      4  select 10 as empno, '08:30' as nightshifthrs from dual union all
      5  select 10 as empno, '10:00' as nightshifthrs from dual union all
      6  select 10 as empno, '07:45' as nightshifthrs from dual union all
      7  select 10 as empno, '09:00' as nightshifthrs from dual)
      8  select sum(to_number(substr(nightshifthrs,1,2))) + SUM(to_number(SUBSTR(nightshifthrs,4,5)))/60
      9* from tab1
    SQL> /
    HOURS_WORKED
            41.5
    SQL> Hope this helps.
    Craig...

Maybe you are looking for

  • Get current customer in CIC and pass it to BSP

    Hi experts, I'm new to the CIC application but very familiar with CRM Web Client. The customer embedded a z-BSP into it's business role to call a SAP GUI transaction in a new window. This works. Now, the current customer, which is selected in interac

  • Problem adding a new field to existing BPS planning layout

    Hi I am new to BPS and planning I have a requirement to add a new field which has values maintained as 0 and 1 to an existing planning cube.The user wants this new field in the existing planning layout where in he can enter the values for this field

  • Add Spry Widgets to Dreamweaver Insert Bar Spry Group

    Hi. I'm trying to work out how to add Spry widgets to Dreamweaver's Insert bar. I downloaded Spry for Ajax 1.6 and copied the the contents of the SpryTooltip Folder. I did a search in Adobe Dreamweaver's program folder for everything Spry. I pasted S

  • Sound application help

    here is another example of a sound application that does not work. can any one help me fix it?? import java.awt.*; import java.applet.*; import java.net.URL; public class AnotherAudioAttempt{   public static void AlertSound(){     try{       java.io.

  • Is it possible to have java and javafx project types combined ?.

    Today, in NetBeans (not sure about the eclipse world) one has to decide between a "Java" project or a "JavaFX" project. Why can't these two be combined ?. For e.g, when I try to add JavaFX files (script, classes) to a Java Project it fails to compile