Get the sum currency wise.

hi all,
i am using report 6i.
i have written query like below in data model and data is coming correct.
SELECT
     bft_company
,     bft_reference
,     bft_charge_code
,     bft_chg_basis
,     bft_quantity
,     bft_currency
,     bft_local_amount
,     bft_mode
,       bft_remarks
FROM
     Bdl_Freight
WHERE bft_mode = 'C'i want sum(bft_local_amount) group by currency. page wise total and grand total, at the end of the report.
my problem is i am not able to get the pagewise sum.
i have formula like below
SELECT bft_currency, sum(bft_local_amount)
FROM Bdl_Freight
WHERE bft_company = :bft_company
AND bft_reference = :bft_reference
group by bft_currency;from the above forumula i am getting grand total, but i am not able to get the page wise column. due to lack of "reset at" property.
How can i get the pagewise total baseed on the currency.
Please help.
Thanks..

Hi
In Report you can get sum values based on group values/full report.
In case if you want per page- i think you should do manually like predefined rows. But is not advisable way.
Please check below link, you may have some idea
How to display pagewise total in Oracle reports?
Edited by: AppsLearner on Aug 1, 2012 9:11 AM

Similar Messages

  • Get the sum/product of two UDF rows before adding A/R Invoice

    Hi Everyone,
    I am making some tests here where I am trying to get the sum or product of two UDF rows in a service type A/R invoice where I need to get the product before i even add the document.
    The query goes like:
    SELECT T0.[U_UDF1] * T0.[U_UDF2] FROM INV1 T0 WHERE T0.[U_UDF1] = $[INV1.U_UDF1]
    It did not work. Is this possible?
    Thanks,
    Derrick

    Before you add a transaction, the values you specify in the screen are not stored into the database. In an FS you can use SQL statements but in these statements you can refer only to the actual header or row level data with the special expressions starting with $. The system replaces these expressions with a constant containing the actual value before executing the SQL string.
    So there is no possibility to sum the columns with FS before adding the document.
    Sorry, I didnu2019t read carefully your question and probably misunderstood it.
    Edited by: István K#rös on Jan 13, 2011 11:27 AM

  • Getting the sum of all members in a hierarchy....

    Hi,
    I want to get the sum of each member in a hierarchy....
    The hierarchy is defined in the table strdet:
    create table strdet
    (costcenterms varchar2(20),     // parent
    costcenterdet varchar2(20),    // child
    lev varchar2(1))The values for each object/material per costcenter(child) is defined in the table details_det:
    create table details_det
    (costcenterms varchar2(20),
    eppid varchar2(30) ,
    purchcontyear0 number(4,1) )Some sample data:
    insert into strdet values ('1' , '1.1','2')
    insert into strdet values ('1' , '1.2','2')
    insert into strdet values ('1.1' , '1.1.1','3')
    insert into strdet values ('1.1' , '1.1.2','3')
    insert into strdet values ('1.2' , '1.2.1','3')
    insert into strdet values ('1.2' , '1.2.2','3')
    insert into strdet values ('1.2' , '1.2.3','3')
    insert into strdet values ('1.1.1' , '1.1.1.1','4')
    insert into strdet values ('1.1.1' , '1.1.1.2','4')
    insert into strdet values ('1.1.2' , '1.1.2.1','4')
    insert into strdet values ('1.2.1' , '1.2.1.1','4')
    insert into strdet values ('1.2.1' , '1.2.1.2','4')
    COMMIT;
    insert into details_det values('1.1.1.1','epp1',10);
    insert into details_det values('1.1.1.1','epp2',20);
    insert into details_det values('1.1.1.1','epp3',0);
    insert into details_det values('1.1.1.2','epp1',0);
    insert into details_det values('1.1.2.1','epp2',5);
    insert into details_det values('1.1.2.1','epp4',15);
    insert into details_det values('1.2.1.1','epp1',65);
    insert into details_det values('1.2.1.1','epp2',95);
    insert into details_det values('1.2.1.2','epp1',5);
    commit;The output of the desired sql stmt must be like this:
    costcenter             val
    1                        220
    1.1                       55
    1.2                     165
    1.1.1                    30
    1.1.2                    20
    1.2.1                  165I have written the following , so far.....
    SQL> select distinct s.costcenterms , sum(purchcontyear0) over(partition by s.costcenterms order by s.costcenterms)
      2        from details_det d , strdet s
      3        where s.costcenterdet=d.costcenterms(+)
      4        start with s.costcenterms='1'
      5             connect by  s.costcenterms = prior s.costcenterdet
      6        order by s.costcenterms
      7  /
    COSTCENTERMS                                                 SUM(PURCHCONTYEAR0)OVER(PARTIT
    1.2                                                         
    1.2.1                                                                                   165
    1.1.1                                                                                    30
    1.1.2                                                                                    20
    1                                                           
    1.1                                                         
    6 rows selectedHow should i modify the above sql stmt to get the desired result...????
    Note: I use OracleDB 10g. v.2
    Thanks, a lot
    Sim

    I' m grateful to all.....!!!!
    I connected as user SYS so as to give the appropriate privileges to SCOTT schema ....
    SQL*Plus: Release 10.2.0.1.0 - Production on Êõñ Óåð 14 11:03:44 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    SQL> connect sys/***@info as sysdba;
    Connected
    SQL> grant create materialized view to scott;
    Grant succedded
    SQL> grant alter any materialized view to scott with admin option;
    Grant succedded
    SQL> connect scott/tiger@info;
    Connected
    SQL> create materialized view mv 
      2  as
      3  select s.costcenterms , sum(connect_by_root d.purchcontyear0) sum_cbr
      4   from details_det d  , strdet s
      5   where s.costcenterdet = d.costcenterms(+)
      6  connect by s.costcenterdet = prior s.costcenterms
      7  group by s.costcenterms
      8  order by length(s.costcenterms) , s.costcenterms ;
    create materialized view mv
    Error in line 1
    ORA-30361: unrecognized string type
    SQL> create materialized view x_mv
      2  as
      3  select grp, sum(purchcontyear0)
      4  from (
      5  select connect_by_root s.costcenterms grp, d.purchcontyear0
      6   from strdet s, details_det d
      7  where s.costcenterdet=d.costcenterms(+)
      8  connect by s.costcenterms = prior s.costcenterdet
      9  )
    10  group by grp
    11  /
    Materialized view created
    SQL> create materialized view mv 
      2  as
      3  select s.costcenterms , sum(connect_by_root d.purchcontyear0) sum_cbr
      4   from details_det d  , strdet s
      5   where s.costcenterdet = d.costcenterms(+)
      6  connect by s.costcenterdet = prior s.costcenterms
      7  group by s.costcenterms ;
    create materialized view mv
    Error in line 1
    ORA-30361: unrecognized string typeTo sum up.....
    Rob's version of definition of mv is unsuccessful... even when i omit the order by clause.... whereas SY's version is successful..... Can you imagine why since... as Rob posted above , it is successful in his environment......!!!!!
    Note: As regards the ORA- error , the cause and action of Oracle is as follows:
    Cause: An internal Oracle error occured.
        Action: Report the problem through your normal support channels. Thanks again,
    Sim

  • Getting the sum of the elements in an array

    Hello all,
    Any ideas on how to easily get the sum of the elements of an array of floating points (or any data type for that matter ) this is to be part of a method.
    arrayName (float [] floaters)
    Thanks

    int total=0;
    for(int a=0; a<array.length; a++){
      total=total+array[a];
    }now is that so hard?
    or even as a method
    public int addUp(int[] array){
       int total=0;
       for(int a=0; a<array.length; a++){
          total=total+array[a];
       return total;
    }to be used as
    int total=addUp(array);just write your own!

  • How do you get the sum of two columns multipied together?

    I can't seem to figure out how to get the sum of two columns multiplied together without having to manually type out each location (example: A1*B1+A2*B2+A3*B3, etc..).  Though the idea seems to be rather simple, everything I have tried has only given me an error.  I know there must be an easier way of doing this, but I get lost in the explanations given in 'help' area of numbers, can someone help me?

    C3=SUMPRODUCT(A3:A18, B3:B18)
    the function SUMPRODUCT() takes ranges and multiplies corresponding cells in the ranges, then adds them together.
    I the case I show SUMPRODUCT() performs:
    A3*B3 + A4*B4 + A5*B5 + A6*B6 + ... +  A18*B18
    If you want to perform the same operation on the whole column (s) you could modify the formula:
    C3=SUMPRODUCT(A, B)

  • How to get the sum total of just one row in the dashboard

    How do I get the sum total of one row in the compound layer results. This is 11g
    Does anyone know?
    may be sales, I need the total at the bottom of the row..
    thx
    Chuck

    I fnd the answer,
    in the table view, click edit then nxt to the columns and measures there is total sum icon. Click that, and choose after

  • Need to get rolling sum year wise in a query.

    Hi all,
    I have a table with monthid and amt columns. values are like
    200501 5
    200502 6
    200503 6
    200601 7
    200602 8
    200603 9
    Like this i have data for all months in year. now i need to get rolling sum year and
    month wise. the output should be like
    200501 5
    200502 11
    200503 17
    200601 7
    200602 15
    200603 24
    please help me out to write a query for this.
    Thanks,
    Chandu

    May be you want this
    dev>select deptno,ename, sal,
      2                    sum(sal)over(partition by deptno order by ename)as sum_on_dept
      3                 from emp;
        DEPTNO ENAME                                                     SAL SUM_ON_DEPT
            10 CLARK                                                    2450        2450
            10 KING                                                     5000        7450
            10 MI_LL_ER                                                 1300        8750
            10 T*_1NU                                                   2000       10750
            20 ADAMS                                                    1100        1100
            20 FO__RD                                                   3000        4100
            20 JONES                                                    2975        7075
            20 SCOTT                                                    3000       10075
            20 SH_*U                                                    3200       13275
            20 SMITH                                                     800       14075
            30 ALLEN                                                    1600        1600
            30 BLAKE                                                    2850        4450
            30 JAMES                                                     950        5400
            30 MARTIN                                                   1250        6650
            30 TURNER                                                   1500        8150
            30 WARD                                                     1250        9400
            30 DEEP                                                   3000       12400
               D.EV                                                     5000        5000

  • How to get the sum in BSEG table using select statement

    hai all
    i made the internal tale "itab1" .. i want to get the som  feild of  DMBTR in BSG table my code is here but its not working gave som error massage (Aggregate functions and the addition DISTINCT are not supported in field lists for pooled and cluster tables.)  plz tel me how should i do it..... i want to get the som of that feild....          
    loop at itab1
         SELECT sum( DMBTR  ) from bseg INTO itab1-DMBTR141_45
             where GJAHR = itab1-GJAHR
             and   BELNR = itab1-BELNR.
    endloop.
    regard
    nawa

    SELECT BELNR GJAHR SHKZG DMBTR
                 from bseg
                 INTO table it_bseg
                 for all entries in itab1
                 where GJAHR = itab1-GJAHR
                   and BELNR = itab1-BELNR.
    loop at it_bseg.
        IF it_bseg-shkzg = 'H'.
          it_bseg-dmbtr = it_bseg-dmbtr * ( -1 ).
        ELSE.
          it_bseg-dmbtr = it_bseg-dmbtr.
        ENDIF.
        MODIFY it_bseg.
    endloop.
    loop at it_bseg.
    READ TABLE itab1 with key belnr = it_bseg-belnr
                               gjahr = it_bseg-gjahr.
    if sy-subrc = 0.
    collect it_bseg into it_bseg_amount.
    endif.
    endloop.
    U can use the collect statement
    Regards
    Gopi

  • How to get the sum in appropriate column without a red triangle appearing?

    Hello,
    In 'Numbers" - How do get columns to add (calculate) the sum in each decending column on an Expense Report.
    When I highlight the decending column the total appears on the far left of the screen.  When I drag the sum amount from there to the appropriate column a red triangle with an ! appears instead of the amount.
    Thanks for your immediate help.

    The red triangle is an Error triangle. Clicking it will display the error message and tell you what error has occurred. From your description, my assumption is that you dragged the SUM() function from the quick calculations at the lower left and dropped it intto a cell in the column being summed.
    If that's the case, this is likely the error message you would see:
    When you highlighted the 'decending column,' you likely selected all of the cells in that column, including the one into which you dropped the function.
    Instead, do one of the following. These assume the column you want to sum is column B.
    If you want the sum at the top of the column:
    Make sure the row you want the sum to appear in is a Header row.
    Enter this formula into any Header Row cell in column B:   =SUM(B)
    If you want the sum at the bottom of the column:
    Add a Footer row to the table. (Go Table (menu) > Footer Rows > 1).
    Enter this formula into the Footer Row cell in column B:   =SUM(B)
    SUM (and other functions) that expect a range of cells will interpret a cell reference entered using only the column letter (B) as meaning 'all of the non-header, non-footer cells in column B', and will exclude those cells in header or footer rows.
    Regards,
    Barry

  • SSRS report with tabular model – MDX query how to get the sum and count of measure and dimension respectively.

    Hello everyone,
    I am using the following MDX query on one of my SSRS report.
    SELECT NON EMPTY { [Measures].[Days Outstanding], [Measures].[Amt] } ON COLUMNS,
    NON EMPTY { ([Customer].[Customer].[Customer Key].ALLMEMBERS) }
    HAVING [Measures].[ Days Outstanding] > 60
    DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
    FROM ( SELECT ( STRTOSET(@Location, CONSTRAINED)) ON COLUMNS
    FROM ( SELECT ( {[Date].[Fiscal Period].&[2014-06]}) ON COLUMNS
    FROM [Model]))
    Over here, the data is being filtered always for current month and for a location that is being selected by user from a report selection parameter.
    I would like to get the count of total no. of customers and sum of the amount measure.
    When I am using them in calculated members it gives incorrect values. It considers all records (ignores the sub-select statements) instead of only the records of current month and selected location.
    I also tried with EXISTING keyword in calculated members but there is not difference in output. Finally, I manage the same at SSRS level.
    Can anybody please advise what are the ways to get the required sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension?
    Also, does it make any difference if I manage it as SSRS level and not at MDX query level?
    Any help would be much appreciated.
    Thanks, Ankit Shah
    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

    Can anybody please advise what are the ways to get the required sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension?
    Also, does it make any difference if I manage it as SSRS level and not at MDX query level?
    Hi Ankit,
    We can use SUM function and COUNT function to sum of [Measures].[Amt] and count of [Customer].[Customer].[Customer Key].ALLMEMBERS dimension. Here is a sample query for you reference.
    WITH MEMBER [measures].[SumValue] AS
    SUM([Customer].[Customer].ALLMEMBERS,[Measures].[Internet Sales Amount])
    MEMBER [measures].[CountValue] AS
    COUNT([Customer].[Customer].ALLMEMBERS)
    MEMBER [Measures].[DimensionName] AS [Customer].NAME
    SELECT {[Measures].[DimensionName],[measures].[SumValue],[measures].[CountValue]} ON 0
    FROM [Adventure Works]
    Besides, you ask that does it make any difference if I manage it as SSRS level and not at MDX query level. I don't thinks it will make much difference. The total time to generate a reporting server report (RDL) can be divided into 3 elements:Time to retrieve
    the data (TimeDataRetrieval);Time to process the report (TimeProcessing);Time to render the report (TimeRendering). If you manage it on MDX query level, then the TimeDataRetrieval might a little longer. If you manage it on report level, then the TimeProcessing
    or TimeRendering time might a little longer. You can test it on you report with following query: 
    SELECT Itempath, TimeStart,TimeDataRetrieval + TimeProcessing + TimeRendering as [total time],
    TimeDataRetrieval, TimeProcessing, TimeRendering, ByteCount, [RowCount],Source
    FROM ExecutionLog3
    WHERE itempath like '%reportname'
    Regards,
    Charlie Liao
    TechNet Community Support

  • Get the sum of values and show only max(Date)

    Hi,
    I have a below query and the value
    select PO_No,DATE,RCVD,LINE_QTY,QTY_INVCD,PART_NO from Purchase                         
    PO_No     DATE     RCVD LINE_QTY QTY_INVCD     PART_NO
    PO1460 12/02/2007 11     20     12     0995-13
    PO1460 13/12/2006 4     20     12     0995-13
    PO1460 05/04/2007 5     20     12     0995-13
    In the above table,
    PO_No ,Line_Qty ,Qty_INVCD,Part_No all are same value.
    Now I want the sum ( rcvd,line_qty)
    i.e.,
    Select po_no,date,sum(rcvd) over (partition by line_quantity) RCVD,line_qty,qty_invcd,part_no from Purchase
    Its look like
    PO_No     DATE     RCVD LINE_QTY QTY_INVCD     PART_NO
    PO1460 12/02/2007 20     20     12     0995-13
    PO1460 13/12/2006 20     20     12     0995-13
    PO1460 05/04/2007 20     20     12     0995-13
    Now what I want is
    I want the value for only max(Date)
    b]PO_No     DATE     RCVD LINE_QTY QTY_INVCD     PART_NO
    PO1460 05/04/2007 20     20     12     0995-13
    How will I write a query?
    Likewise I have many PO_No PO100,PO101,PO102,..........

    No need to use subquery to get this result:
    WITH data AS (select 'PO1460' po_no, to_date('12/02/2007','dd/mm/yyyy') datum, 20 recvd, 20 line_qty, 12 qty_invcd, '0995-13' part_no FROM dual
    UNION all
    select 'PO1460', TO_DATE('13/12/2006','dd/mm/yyyy'), 20, 20, 12, '0995-13' FROM dual
    UNION all
    select 'PO1460', to_date('05/04/2007','dd/mm/yyyy'), 20, 20, 12, '0995-13' FROM dual
    UNION all
    select 'PO1462', TO_DATE('13/12/2006','dd/mm/yyyy'), 30, 20, 12, '0995-13' FROM dual
    UNION all
    select 'PO1462', to_date('15/04/2007','dd/mm/yyyy'), 15, 20, 12, '0995-13' FROM dual
    UNION all
    select 'PO1462', TO_DATE('13/12/2006','dd/mm/yyyy'), 40, 20, 12, '0995-13' FROM dual
    UNION all
    select 'PO1461', to_date('15/04/2007','dd/mm/yyyy'), 15, 20, 12, '0995-13' FROM dual
    UNION all
    select 'PO1463', TO_DATE('13/12/2006','dd/mm/yyyy'), 30, 20, 12, '0995-13' FROM dual
    UNION all
    select 'PO1463', to_date('15/04/2007','dd/mm/yyyy'), 15, 20, 12, '0995-13' FROM dual
    SELECT po_no, sum(recvd) keep (dense_rank first ORDER BY datum desc)
    FROM data
    GROUP BY po_no
    will do the same

  • I can't get the Sum of a Column

    I was hoping someone would be able to help me figure out what I'm doing wrong on a form that I'm unable to get a SUM of a column for?  I'm new to LiveCycle Designer and have poured over all that I can find on the internet to figure this out but it's been 10+ hours and I'm no closer now then when I started. Specifically, I added a table to a form that has a multiplication formula set up in each of the ROWs (item * cost = total kind of scenario). These formula's work and give me the the $ amount in the last column titled "total." The problem is I can't figure out how to get a sum of the totals for the "grandtotal" cell at the bottom? Each formula I've tried gives me a warning that "total[*] is unknown" so it makes me think I have my cell menu's set up incorrectly since it's not registering it the $ amount in my "total" cells?  This is work project and I'm at a stopping point until I can figure this out so any help is gratefully appreciated.  Donna
    Table/Row/Column Info:
    My table is: table 3
    My row is: cell1 (all are called cell1)
    My column is total1 (I've changed these to total 1, total2, total3, etc in my efforts to troubleshoot)
    FormCalc entries that I've tried:
    Sum(total[*])
    Sum(total[*]).amount[*])
    $ = Sum(total1.amount + total1.amount + total3.amount)
    Sum(table3.cell[*].total[*])

    HI,
    It appears you've phyically created 3 indivdual rows (correct me if I'm mistaken), so if that's the case...you can simply capature the GrandTotal by adding the fields using by their respective names. Thus, the GrandTotal script would be:  $ = Sum(total1+toal2+total3). Im not sure why you're using ".amount".
    [*] is used when you have repeating subforms. So, say you started out with a single row (Row1) with the following fields: Qty, UnitCost, Total... where Total (field in last column) had the follwoing script: $ = Qty * UnitCost
    If your form was "dynamic" and used an Add Row button, then you would only have to create one row and enable your user to "Add" additional rows, as needed.  As a result, you would need to use an array [*] to find all instances of Total on each row.
    In that case, your script for GrandTotal would look like this: $ = Sum(Page1.Items.Row1[*].Total). Note: Page1.Items is the absoulte location for Row1 on my form, so this would change for you.
    Going back to my previous comment, since your form doesn't appear to use an Add row button, you shoudl be able to add the fields names quite easily.
    Lastly, as an FYI,  you shouldn't need a [*] after total in......Sum(table3.cell[*].total[*])
    Let me know if this helps!
    Thanks
    Shaun

  • To get the sum of leave an  employee has taken

    hi all
    i have this query
    SELECT   dif.employee_number, dif.full_name employeename,
             TO_CHAR (date_entray, 'DY') DAY, date_entray attendance_date,
             TO_CHAR (start_date, 'dd-Mon-rrrr') doj, dif.dept_name, POSITION,
             tran_name, insert_type, day_desc,
             CASE
                WHEN insert_type = 'AnLv'
                   THEN COUNT
                          (insert_type)
             END days_anlv,
             CASE
                WHEN insert_type = 'SkLv'
                   THEN COUNT (insert_type)
             END days_sklv,
             CASE
                WHEN insert_type = 'BTrp'
                   THEN COUNT (insert_type)
             END days_btrp
        FROM nap_punch_data_emp_list trn, nap_emp_def dif,
             nap_punch_card_eleg ele
       WHERE trn.employee_number = dif.employee_number
         AND ele.employee_number = trn.employee_number
         AND date_entray BETWEEN :p_from_date AND :p_to_date
         AND trn.employee_number BETWEEN NVL (:p_emp_no, trn.employee_number)
                                     AND NVL (:p_emp_no2, trn.employee_number)
    GROUP BY dif.employee_number,
             dif.full_name,
             start_date,
             dif.dept_name,
             POSITION,
             tran_name,
             insert_type,
             date_entray,
             day_desc
    ORDER BY date_entray
    the output of which is
    EMPLOYEE_NUMBER     ATTENDANCE_DATE    INSERT_TYPE                            DAYS_ANLV                              DAYS_SKLV                                   DAYS_BTRP
    686                       04/18/2012          annual leave                          1
    688                        04/18/2012     sick leave                                                                         1
    689                     04/18/2012        annual leave                               1
    686                   04/19/2012        annual leave                                 1
    69                 04/19/2012          businesstrip                                                                                                                       1                         
    69               04/19/2012          businesstrip                                                                                                                         1
                is it possible to obtain
    employee number                                        days_anlv                            days_btrp
    686                                                                  2    
    69                                                                                                             2the sum of the respective leaves each employee has taken
    kindly guide
    thanking in advance
    Edited by: makdutakdu on Jun 24, 2012 2:59 PM
    Edited by: makdutakdu on Jun 24, 2012 3:00 PM
    Edited by: makdutakdu on Jun 24, 2012 3:01 PM
    Edited by: makdutakdu on Jun 24, 2012 3:02 PM
    Edited by: makdutakdu on Jun 24, 2012 3:03 PM
    Edited by: makdutakdu on Jun 24, 2012 3:03 PM
    Edited by: makdutakdu on Jun 24, 2012 3:04 PM
    Edited by: makdutakdu on Jun 24, 2012 3:26 PM
    Edited by: makdutakdu on Jun 24, 2012 3:27 PM
    Edited by: makdutakdu on Jun 24, 2012 3:28 PM
    Edited by: makdutakdu on Jun 25, 2012 9:05 AM

    Hi,
    makdutakdu wrote:
    hi all
    i have this query
    SELECT   dif.employee_number, dif.full_name employeename,
    TO_CHAR (date_entray, 'DY') DAY, date_entray attendance_date,
    TO_CHAR (start_date, 'dd-Mon-rrrr') doj, dif.dept_name, POSITION,
    tran_name, insert_type, day_desc,
    CASE
    WHEN insert_type = 'AnLv'
    THEN COUNT
    (insert_type)
    END days_anlv,
    CASE
    WHEN insert_type = 'SkLv'
    THEN COUNT (insert_type)
    END days_sklv,
    CASE
    WHEN insert_type = 'BTrp'
    THEN COUNT (insert_type)
    END days_btrp
    FROM nap_punch_data_emp_list trn, nap_emp_def dif,
    nap_punch_card_eleg ele
    WHERE trn.employee_number = dif.employee_number
    AND ele.employee_number = trn.employee_number
    AND date_entray BETWEEN :p_from_date AND :p_to_date
    AND trn.employee_number BETWEEN NVL (:p_emp_no, trn.employee_number)
    AND NVL (:p_emp_no2, trn.employee_number)
    GROUP BY dif.employee_number,
    dif.full_name,
    start_date,
    dif.dept_name,
    POSITION,
    tran_name,
    insert_type,
    date_entray,
    day_desc
    ORDER BY date_entray
    the output of which is
    EMPLOYEE_NUMBER     ATTENDANCE_DATE    INSERT_TYPE                DAYS_ANLV                              DAYS_SKLV                                   DAYS_BTRP
    686                       04/18/2012          annual leave                                     1
    688                        04/18/2012     sick leave                                                                                            1
    689                     04/18/2012        annual leave                                         1
    686                   04/19/2012        annual leave                                            1
    69                 04/19/2012          businesstrip                                                                                                                                               1                         
    69               04/19/2012          businesstrip                                                                                                                                                  1
    When posting formatted code, make sure it appears on this site so that people can read and understand it. Does the output above look okay ih your browser? I can;t tell which numbers are supposed to be in which columns. Use the "Preview" tab and edit your message, if necessarry, before posting.
    is it possible to obtain
    employee number days_anlv days_btrp
    686 2
    69 2
    the sum of the respective leaves each employee has takenIt's unclear what you want, but I'm sure you can do it.
    Whenever you have a question, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using.
    See the forum FAQ {message:id=9360002}
    If you only want one row of output for each employee_number, then employe_number should be the only thing in the GROUP BY clause.
    You may need to do 2 GROUP BYs; one in a sub-query, and the the other (with employee_number alone in the GROUP BY clause) in the main query.
    Why do the results not include employee_numbers 688 and 689?

  • Need help with Expressions to get the sum of rows between dates

     Date              Total
    8/06/2010     $2000
    8/10/2010    $5000
    8/28/2010      $2500
    9/10/2010    $5000
    9/16/2010   $2000
    9/25/2010   $7000
    9/28/2010     $2500
    I need sum of rows based on month. I have tried  following syntax. It did not work, which is returning $0.  Appreciate any help i get.
    =sum(iif(Date.value>="8/01/2010" AND Date.value<="8/30/2010",Total.value,0))

    Hi RG K,
    According to your description, you want to calculate sum of total based on month use expression, but the expression does not work. If that is the case, please refer to the following steps:
    In design surface, right-click Insert and click Text Box.
    Right-click inside of the text box, then click expression.
    In Expression text box, type the expression like below:
    =sum(iif(Fields!Date.Value>="8/01/2010" AND Fields!Date.Value<="8/30/2010",Fields!total.Value,CDec(0)))
    In this expression, the data type of total is Decimal, so we need to convert 0 to Decimal use CDec() function. If data type of total is Double, we need to use CDbl() function.
    The following screenshot is for your reference:
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • How to get the count monthly wise

    Hi All
    I have lot of order dispatched in a year 2010, how to get the moth wise total.
    For example jan 1000 orders ,feb 2500 orders.
    Thanks & Regards
    Srikkanth.M

    Pleiadian wrote:
    Maybe even
    b.schedule_ship_date between to_date('2010','YYYY') and to_date('2011','YYYY');)But this could return schedule ship dates that are 01-Jan-2011 00:00:00. I don't think this is wanted since it was not specified in the original requirement. I'm not even sure if to_date('2010','YYYY') returns 01. Feb.2010 in a few days (when we will have february).
    Just checking the docs....
    found it: http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements003.htm#SQLRF51062
    from the docs:
    If you specify a date value without a time component, then the default time is midnight (00:00:00 or 12:00:00 for 24-hour and 12-hour clock time, respectively). If you specify a date value without a date, then the default date is the first day of the current month.Just to be on the safe side always give the complete format mask!
    b.schedule_ship_date >= to_date('01012010','DDMMYYYY')
    and b.schedule_ship_date < to_date('01012011','DDMMYYYY')Edited by: Sven W. on Jan 17, 2011 5:14 PM

Maybe you are looking for

  • Problems installing Oracle 9i Database on Windows XP Pro

    Please Help!!!!!!!!! When trying to install the Personal Edition Database, the installer never asks for the additional disk to be inserted and, after running for a while the Universal Installer disappears with no error window, therefore not completin

  • Iphoto and aperture all latest versions

    Hi i am using a macbook pro with all the latest software my issue is regarding aperture. when i open front row and select aperture as main photo libary the number of pictures in the iphoto library are differentto aperture number of pictures can any o

  • Is it possible to add/remove a person from a group using workflow?

    Hi All, Is it possible to add/remove a person from a group using workflow?

  • Error message when moving or updating contacts

    When i try to move a contact to my contacts in iCloud, I get a message "cannot move the items. Access is denied. Verify the disk is not full or write-protected and that the file is not being used." This just started to happen recently. also, when try

  • How Forms 6i could connect to remote database 9i

    AOA, Our company has different sites located in different cities. In the main office we have developed many modules using Oracle 9i and Developer 6i and our data is highly confidential. In all remote sites our modules are running by standalone. Now w