Summing based on matched data

I have an odd sum issue that's been plaguing me for a year or so and I figure it's time to get it taken care of.   I have some data that I have to sum.  I have to sum them based on the data in the first column.  Easier to explain with an example.
 Note that column D is what I want the result to be... columns A, B and C are the data I'm starting with.
A B C D117 6 0 8
117 2 0
118 1 0 7
118 0 3
118 3 0
121 0 1 5
121 4 0
For the above, what I'm looking for is a total of B&C, based on the value of A...  so all the B&C values where A is 117 adds up to 8.  All the B&C values where A is 118 adds up to 7, etc.  I don't even mind if the D result is duplicated
in every row...  So the cells in D being 8, 8, 7, 7, 7, 5, 5 would be fine.  I just need to be able to see what the totals are for all of the entries that start with "117" versus the totals of "118".  
I know there are lots of ways to slay this beast, but my problem is that I need it done in the way I've described... no grouping, no pivot tables, no calculations elsewhere.  I have LOTS of data that will continue to grow and this all gets exported
to other places, so the formatting has to be pretty much what I have above.  
Can someone get me pointed in the right direction here?
--smthng

Re:  sum with multiple criteria in multiple columns
With the data starting in A3 and extending to row 99...
  =SUMIF($A$3:$A$99,A3,$B$3:$B$99)+SUMIF($A$3:$A$99,A3,$C$3:$C$99)
Jim Cone
Portland, Oregon USA
XL Professional excel add-in (commercial program)
https://jumpshare.com/b/O5FC6LaBQ6U3UPXjOmX2

Similar Messages

  • How to find the Sum based on Like Dates

    Hello everyone,
    Column 1 contains "Date Sent", Column 2 contains "Dates of Service" and Column 3 contains the payment "Amount" in USD. I want to write a formula that will total up the sum of payment values from column 3 based on the date of payment (Column 1).
    Thanks!
    Jared

    Hi Jared,
    This will do what's illustrated in your example, but has a few restrictions:
    The dates must run in ascending order.
    To get a total for the last date, a later date (with no corresponding amount) must be entered after the last transaction.
    Formula:
    Entered in D2, and filled down the rest of column D:
    =IFERROR(IF(A3>A2,SUMIF($A,A2,C),""),"")
    IFERROR is used to suppress the error message that arises from the formula in D10 referencing a cell in D11.
    Regards,
    Barry

  • Creating parameter based on Submit Date from Remedy ITSM

    I am new to creating Crystal Reports and I am using Crystal Reports XI. I am pulling information from BMC Remedy ITSM through an ODBC connection. I have created a report from HPD_Help_Desk that pulls the Incident Number, Submit Date, Submitter, Owner and Description. I am not having any problems pulling the information from the tables. The issue that I am running into is creating a new parameter field that can be used so that when the people that will be running this report can pull information based on a date range of the submit date. When the report is run, it pulls the datetime from Remedy ITSM in a mm/dd/yyyy hh:mm:ss format with AM or PM on the end. I have created a parameter named Date Range that has a static list of values. The Type of the parameter is Date Time. The Value Field is Submit_Date. I have selected true for allowing custom values and allowing range values. The objective is to have the person running the report type in the datetime range such as Start of Range Value: 11/22/2009 00:00:00AM and End of Range Value: 11/28/2009 23:59:59PM so that they get all data for Incidents created from the start of the day on the 22nd to through the end of the day on the 28th providing 1 weeks worth of data. I know selection criteria can be used to run for the previous full week, but this will not help if people want to check on historical data. When the parameter is added to the report, it requests the datetime ranges be entered in a yyyy-mm-dd hh:mm:ss format. I have entered in datetime ranges and it will not filter the data. I receive data back for all dates even outside the range requested. I have attempted to change the format of the Submit Date within the report to match what the parameter is asking for and receive the same results. Any help would be greatly appreciated. Thank you in advance.

    Thank you for the feedback Carl. Again, I am new to this, so please be patient with me. I am not sure what you mean about adding the parameter to the record selection formula. I have drug the parameter field into the report so that it will prompt for parameters before running, but I do not think that is what you are talking about. Please advise.
    To your question about the Submit Date field in the report, when I open up the report and I point at the field for Submit Date the popup shows HPD_Help_Desk.Submit_Date (DateTime). That being the case, I think the answer to your question is that the data type of the data being returned is DateTime. Thanks again for the assistance.

  • Analysis for Office 1.4.7 Can't do calculation based on HANA data

    Hi,
    We are currently using Analysis for office 1.4.7 based on HANA data. When we try to use calculation, we got following error.
    Nested exception. See inner exception below for more details:
    Unable to execute SQL statement (CREATE_COLUMN_VIEW) \: CREATE OLAP SCENARIO '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <cubeSchema operation="createCalculationScenario" version="3">
        <calculationScenario name="POC-zmlf-fico-histcopatma-pkg/CALV_SHCOPATMA_MUL_1408373161431" schema="_SYS_BIC">
            <scenarioHints createInMemoryOnly="false"/>
            <dataSources>
                <analyticDataSource view="POC-zmlf-fico-histcopatma-pkg/CALV_SHCOPATMA_MUL" schema="_SYS_BIC" name="columnViewSource">
                    <attributes>
                        <allAttribute/>
                    </attributes>
                </analyticDataSource>
            </dataSources>
            <calculationViews>
                <aggregation defaultViewFlag="true" name="defaultAggregation">
                    <inputs>
                        <input name="columnViewSource"/>
                    </inputs>
                    <viewAttributes>
                        <allViewAttribute/>
                    </viewAttributes>
                    <keyfigures>
                        <allKeyfigure/>
                         <calculatedKeyfigure datatype="double" aggregationType="sum" name="[Measures]_Formula1">
        <formula>("G_QVVNTW" - "ZKGPSTD")</formula>
    </calculatedKeyfigure>
                    </keyfigures>
                </aggregation>
            </calculationViews>
        </calculationScenario>
    </cubeSchema>' (ERROR [S1000] [SAP AG][LIBODBCHDB32 DLL][HDBODBC32] General error;258 insufficient privilege: Not authorized)
    Currently the account we use has select access to "_SYS_BIC". What else do we need in term of priviledge?
    Thanks.
    Terry

    Hi Tammy,
    We can do calculations now with Create Scenario" system privilege.
    The issue I am facing was what objects we can do calculation and what objects I can't or should not.
    Example:
         I can do calculation between kilos and Net Weight(Kilos) since both are quantity. Once I bring in Gross Profit at Standard which is dollar value into my calculation, I got "No applicable data found".

  • Get weeks based on start date

    Hi ,
    i need a query that will determine the weeks based on start date.
    if the table consists of:
    vDate vAmount
    06/25/2007 100
    06/27/2007 200
    07/04/2007 400
    If one enters start date as 6/25/2007 , amounts should be broken out in 7 day increments.
    Result should be
    week1 300
    week2 400
    where week1 should be from 6/25/2007 to 07/01/2007,
    week2 should be from 07/02/2007 to 07/08/2007
    and start date is not always on a Monday or Sunday...
    any idea?
    thanks in advance

    try this...
    SQL> with rt as
      2  (select 'week'||(trunc(l/7,0)+1) wk_no,to_char(trunc(sysdate)+l,'dd-Mon-yyyy') dt,to_char(trunc(sysdate)+l,'Day') "Day" from
      3  (select level-1 l from dual connect by level <= 367) where trunc(sysdate) between trunc(sysdate) and add_months(trunc(sysdate),12)),
      4  xx as
      5  (select '06/25/2007' vdate, 100 vamount from dual union all
      6  select '06/27/2007', 200 from dual union all
      7  select '07/04/2007', 400  from dual)
      8  select wk_no,sum(vamount) from
      9  (select (select wk_no from rt where dt = to_date(vdate,'MM/DD/YYYY')) wk_no,vamount from xx)
    10  group by wk_no;
    WK_NO                                        SUM(VAMOUNT)
    week1                                                 300
    week2                                                 400
    SQL>
    SQL> select 'week'||(trunc(l/7,0)+1) wk_no,to_char(trunc(sysdate)+l,'dd-Mon-yyyy') dt,to_char(trunc(sysdate)+l,'Day') "Day" from
      2  (select level-1 l from dual connect by level <= 367) where trunc(sysdate) between trunc(sysdate) and add_months(trunc(sysdate),12);
    WK_NO                                        DT          Day
    week1                                        25-Jun-2007 Monday
    week1                                        26-Jun-2007 Tuesday
    week1                                        27-Jun-2007 Wednesday
    week1                                        28-Jun-2007 Thursday
    week1                                        29-Jun-2007 Friday
    week1                                        30-Jun-2007 Saturday
    week1                                        01-Jul-2007 Sunday
    week2                                        02-Jul-2007 Monday
    week2                                        03-Jul-2007 Tuesday
    week2                                        04-Jul-2007 Wednesday
    week2                                        05-Jul-2007 Thursday
    .

  • Table Comparison to pull back non matching data

    Hello,
    I have been working on the below for a few days now and cannot figure out how to get the desired results. Was hoping someone could point me in the right direction. I have attached the data below and the queries I have come up with so far. I only need data for MU_ID (3,7,4) and only need SKILL_NM ('THICV','HELPDESK_FOUNDATIONAL','SPANISH','AUTO','HELPDESK_COMPLEX','HOUSE_COMPLEX','BOAT','HOUSE','HELPDESK','HELPDESK_MODERATE') as there are hundreds more in the actual tables. I also have the problem of the skill levels for the foundational, moderate, complex skill names from the IEX table. If SKILL_LEVEL is 0-2 on the GEN table they are listed as _FOUNDATIONAL in the IEX table, 3-7 is _MODERATE, 8-10 is _COMPLEX but only for the SKILL_NM 'HELPDESK' & 'HOUSE'.
    CREATE TABLE IEX(
      MU_ID         NUMBER(5),
      AGENT_NM      VARCHAR2(30),
      EXTERNAL_ID   VARCHAR2(8),
      SKILL_NM      VARCHAR2(50))
    CREATE TABLE GEN(
      USER_ID       VARCHAR2(8),
      SKILL_NM      VARCHAR2(255),
      SKILL_LEVEL   NUMBER(10))
    INSERT INTO IEX(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(3,'ROBERTS,CHRIS','ROBERT1','THICV')
    INSERT INTO IEX(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(3,'ROBERTS,CHRIS','ROBERT1','HELPDESK_FOUNDATIONAL')
    INSERT INTO IEX(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(7,'SEW,HEATHER','SEW1','SPANISH')
    INSERT INTO IEX(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(7,'SEW,HEATHER','SEW1','AUTO')
    INSERT INTO IEX(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(4,'PRATT,MIKE','PRATT2','HOUSE_COMPLEX')
    INSERT INTO IEX(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(4,'PRATT,MIKE','PRATT2','HELPDESK_MODERATE')
    INSERT INTO IEX(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('ROBERT1','THICV',1)
    INSERT INTO IEX(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('ROBERT1','HELPDESK',7)
    INSERT INTO IEX(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('SEW1','SPANISH',1)
    INSERT INTO IEX(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('SEW1','BOAT',1)
    INSERT INTO IEX(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('PRATT2','HOUSE',9)
    INSERT INTO IEX(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('PRATT2','HELPDESK',2)
    DESIRED RESULTS:
    MU_ID      AGENT_NM                EXTERNAL_ID      IEX_SKILL_NM                                GEN_SKILL_NM      SKILL_LEVEL
    3                ROBERTS,CHRIS      ROBERT1            NULL                                                     HELPDESK                7
    3                ROBERTS,CHRIS      ROBERT1            HELPDESK_FOUNDATIONAL      NULL                           NULL
    7                SEW,HEATHER           SEW1                      AUTO                                                NULL                           NULL
    7                SET,HEATHER           SEW1                      NULL                                                     BOAT                           1
    4                PRATT,MIKE                PRATT2                 HELPDESK_MODERATE                     NULL                           NULL
    4                PRATT,MIKE                PRATT2                 NULL                                                          HELPDESK                2
    I wrote the 2 below queries, the first one is getting some of the data I need, but not all of it. The second one was something I was playing around with to see if it would do that I need, looks kinda like it works but pulling back way more data than I need and I cannot figure out how to have the skill level data in it.
    SELECT
    A.MU_ID,
    A.AGENT_NM,
    A.EXTERNAL_ID,
    A.SKILL_NM
    FROM IEX A
    WHERE
      A.mu_id IN
       ('3', '4', '7') AND
      UPPER (A.AGENT_NM) NOT LIKE ('%Temp%') AND
        A.EXTERNAL_ID IS NOT NULL
    AND A.SKILL_NM NOT IN
    (SELECT B.SKILL_NM
    FROM GEN B
    WHERE A.EXTERNAL_ID = B.USER_ID
    and A.SKILL_NM = B.SKILL_NM)
    ORDER BY AGENT_NM ASC
    (SELECT
       A.EXTERNAL_ID,
       A.SKILL_NM
    FROM
       IEX A
    WHERE
       A.MU_ID IN ('3', '4', '7')
    MINUS
    SELECT
       B.USER_ID,
       B.SKILL_NM
    FROM
       GEN B
    WHERE
       B.SKILL_NM IN
         ('THICV',
          'HELPDESK_FOUNDATIONAL',
          'SPANISH',
          'AUTO',
          'HELPDESK_COMPLEX',
          'HOUSE_COMPLEX',
          'BOAT',
          'HOUSE',
          'HELPDESK',
          'HELPDESK_MODERATE'))
    UNION ALL
    (SELECT
       B.USER_ID,
       B.SKILL_NM
    FROM
       GEN B
    WHERE
       B.SKILL_NM IN
         ('THICV',
          'HELPDESK_FOUNDATIONAL',
          'SPANISH',
          'AUTO',
          'HELPDESK_COMPLEX',
          'HOUSE_COMPLEX',
          'BOAT',
          'HOUSE',
          'HELPDESK',
          'HELPDESK_MODERATE')
    MINUS
    SELECT
       A.EXTERNAL_ID,
       A.SKILL_NM
    FROM
       IEX A
    WHERE
       A.MU_ID IN ('3', '4', '7'))

    Thanks Frank,
    I guess I explained it wrong. What you provided does pull back non matching data but is also pulling back matching data. Below is the exact query I am using and sample data. What is need  to show all skill_nm that do not match each other from both table. There are a handful of skill_nm that I have to use a condition with levels to make them match up based on "complex" "moderate" "foundational" but only these few need to have that condition and everything else is just straight up does skill_nm from a = skill_nm.
    My current query:
    SELECT
      A.MU_ID,
      A.AGENT_NM,
      B.USER_ID AS EXTERNAL_ID,
      A.SKILL_NM AS IEX_SKILL_NM,
      B.SKILL_NM AS GEN_SKILL_NM,
      B.SKILL_LEVEL
    FROM
      LIGHTHOUSE.IEX_AGT_SKILL A
      FULL OUTER JOIN
      LIGHTHOUSE.CFG_PERSON_SKILL_VALUES B
        ON A.EXTERNAL_ID = B.USER_ID AND
           A.SKILL_NM = B.SKILL_NM
         || CASE
                WHEN B.SKILL_NM NOT IN ('THIPayment','THIPL','SPSC') THEN NULL
              WHEN B.SKILL_LEVEL <= 2 THEN '_FOUNDATIONAL'
            WHEN B.SKILL_LEVEL <= 7 THEN '_MODERATE'
          WHEN B.SKILL_LEVEL <= 10 THEN '_COMPLEX'
         END AND
                A.MU_ID IN
             ('3','4','5','6','7','12','14','220','222','410','411','412','413','414','415','480','600','650','717','720','721',
              '722','723','800','801','3008','3010','3012','3100','4200','4201','4202','4203','4400','4401','4402','4404')
    Doing this, it is looking at the SKILL_LEVEL for all SKILL_NM and pulling back things that do match, but not on the level. I only need to have skill level match up for:
    GENESYS
    IEX
    SKILL LEVEL
    THIPayment
    THIPayment_Complex
    8 to 9
    THIPayment_Foundational
    0-1
    THIPayment_Moderate
    2 to 7
    THIPL
    THIPL_Complex
    8 to 9
    THIPL_Foundational
    0-1
    THIPL_Moderate
    2 to 7
    SPSC
    SPSC_Foundational
    0- 1
    SPSC_Moderate
    2 to 7
    PLSCLegacy
    PLSCLegacy_Complex
    8 to 9
    PLSCLegacy_Foundational
    0- 1
    PLSCLegacy_Moderate
    2 to 7
    PLSCPCIO
    PLSCPCIO_Complex
    8 to 9
    PLSCPCIO_Foundational
    0- 1
    PLSCPCIO_Moderate
    2 to 7
    CREATE TABLE IEX_AGT_SKILL(
      MU_ID         NUMBER(5),
      AGENT_NM      VARCHAR2(30),
      EXTERNAL_ID   VARCHAR2(8),
      SKILL_NM      VARCHAR2(50))
    CREATE TABLE CFG_PERSON_SKILL_VALUES(
      USER_ID       VARCHAR2(8),
      SKILL_NM      VARCHAR2(255),
      SKILL_LEVEL   NUMBER(10))
    INSERT INTO IEX_AGT_SKILL(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(3,'ROBERTS,CHRIS','ROBERT1','THIPayment_FOUNDATIONAL')
    INSERT INTO IEX_AGT_SKILL(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(3,'ROBERTS,CHRIS','ROBERT1','SPSC_FOUNDATIONAL')
    INSERT INTO IEX_AGT_SKILL(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(7,'SEW,HEATHER','SEW1','SPSC_MODERATE')
    INSERT INTO IEX_AGT_SKILL(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(7,'SEW,HEATHER','SEW1','SPSC_BOAT')
    INSERT INTO IEX_AGT_SKILL(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(4,'PRATT,MIKE','PRATT2','THIPayment_COMPLEX')
    INSERT INTO IEX_AGT_SKILL(MU_ID,AGENT_NM,EXTERNAL_ID,SKILL_NM)VALUES(4,'PRATT,MIKE','PRATT2','HELPDESK')
    INSERT INTO CFG_PERSON_SKILL_VALUES(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('ROBERT1','THIPayment',1)
    INSERT INTO CFG_PERSON_SKILL_VALUES(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('ROBERT1','SPSC',7)
    INSERT INTO CFG_PERSON_SKILL_VALUES(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('SEW1','SPSC',1)
    INSERT INTO CFG_PERSON_SKILL_VALUES(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('SEW1','SPSC_BOAT',1)
    INSERT INTO CFG_PERSON_SKILL_VALUES(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('PRATT2','SPANISH',9)
    INSERT INTO CFG_PERSON_SKILL_VALUES(USER_ID,SKILL_NM,SKILL_LEVEL)VALUES('PRATT2','HELPDESK',2)
    DESIRED OUTCOME:
    MU_ID AGENT_NM       EXTERNAL_ID    IEX_SKILL_NM                   GEN_SKILL_NM
    3     ROBERTS,CHRIS  ROBERT1           SPSC_FOUNDATIONAL
    3     ROBERTS,CHRIS  ROBERT1                                                            SPSC_MODERATE
    7     SEW,HEATHER      SEW1                     SPSC_MODERATE
    7     SEW,HEATHER      SEW1                                                                  SPSC_FOUNDATIONAL
    4     PRATT,MIKE            PRATT2                   THIPayment_COMPLEX
    4     PRATT,MIKE            PRATT2                                                              SPANISH

  • Sum reset on the date column when date changes by month

    Hi,,
    I have a query regarding summary columns that is
    " i want to reset the sum of a column based upon the date colum like the totals for the month of August then totals for the month of september and so on whenever a month changes the sum should be calculated separate."
    The dates can be dynamic as they are coming from the user parameters.
    any help???
    thanks.

    Thanks so much rwillems!!
    I have got the required sum but in displaying the data i m facing some problem. I desire that the this sum should display wheren the records of one month end. but by creating a repeating frame in and out of the already present frame doesn't result in this output.
    So if u can further help i will b very gratefull.
    thanks.

  • Can I bulk collect based on a date variable?

    I'm want to use some sort of Bulk collect to speed up this query inside a PL/SQL block (we're in 10g). I have seen examples of using a FORALL statement but I don't know how to accommodate the variable v_cal_date. My idea is to be able to run the script to update a portion of the table "tbl_status_jjs" based on a date range that I provide. tbl_status_jjs contains a list of dates by minute of the day for an entire year and a blank column to be filled in.
    I though of using something like FORALL v_cal_date in '01-apr-2009 00:00:00'..'01-jun-2009 00:00:00' -- somehow need to increment by minute!? ... but that doesn't seem right and i can't find any exmples of a bulk collect based on a date. How do I bulk collect on a date variable? Can I use the date/time from a subset of records from the final table in some sort of cursor?
    Thanks
    Jason
    -- loop through one day by minute of the day and update counts into table  
    v_cal_date Date       :=TO_DATE('01-apr-2005 00:00:00','dd-mm-yyyy hh24:mi:ss');
    intX := 1;
    WHILE intX <= 1440 LOOP
        UPDATE tbl_status_jjs
               SET  (cal_date, my_count) =
                    (SELECT      v_cal_date,
                                 NVL(SUM(CASE WHEN v_cal_date >= E.START_DT AND v_cal_date < E.END_DT THEN 1 END),0) AS my_count
                     FROM        tbl_data_jjs E
               WHERE cal_date = v_cal_date;
        v_cal_date := v_cal_date + (1/1440);
        intX := intX + 1;
        COMMIT;
    END LOOP;

    Here are the two tables. The goal is to find an efficient way to count how many records in tbl_data have a start_dt before and a end_dt after each cal_date in tbl_status.
    01-apr-2005 00:05:00 ==> 3
    01-apr-2005 00:25:00 ==> 1
    DROP TABLE tbl_status;
    CREATE TABLE tbl_status
    (   CAL_DATE    DATE,
        MY_COUNT    NUMBER);
    DECLARE
        start_date Date       :=TO_DATE('01-jan-2006 00:00:00','dd-mm-yyyy hh24:mi:ss');
        end_date   Date       :=TO_DATE('01-jan-2006 01:00:00','dd-mm-yyyy hh24:mi:ss');
    BEGIN
        INSERT INTO tbl_status (CAL_DATE)
        SELECT  start_date + ( (LEVEL - 1) / (24 * 60))
        FROM    dual
        CONNECT BY    LEVEL <= 1 + ( (end_date - start_date) * (24 * 60) );
    END;
    DROP TABLE tbl_data;
    CREATE TABLE tbl_data
    (   START_DT    DATE,
        END_DT      DATE);
    INSERT INTO tbl_data VALUES (TO_DATE('2006-01-01 00:05:00', 'yyyy-mm-dd hh24:mi:ss'), TO_DATE('2006-01-01 00:15:00', 'yyyy-mm-dd hh24:mi:ss'));
    INSERT INTO tbl_data VALUES (TO_DATE('2006-01-01 00:05:00', 'yyyy-mm-dd hh24:mi:ss'), TO_DATE('2006-01-01 00:20:00', 'yyyy-mm-dd hh24:mi:ss'));
    INSERT INTO tbl_data VALUES (TO_DATE('2006-01-01 00:05:00', 'yyyy-mm-dd hh24:mi:ss'), TO_DATE('2006-01-01 00:30:00', 'yyyy-mm-dd hh24:mi:ss'));
    INSERT INTO tbl_data VALUES (TO_DATE('2006-01-01 00:35:00', 'yyyy-mm-dd hh24:mi:ss'), TO_DATE('2006-01-01 00:40:00', 'yyyy-mm-dd hh24:mi:ss'));
    DECLARE
        v_cal_date Date       :=TO_DATE('01-jan-2006 00:00:00','dd-mm-yyyy hh24:mi:ss');
        intX Integer          :=1;
    BEGIN
        WHILE intX <= 60 LOOP
            UPDATE tbl_status
                   SET  (cal_date, my_count) =
                        (SELECT      v_cal_date,
                                     NVL(SUM(CASE WHEN v_cal_date >= E.START_DT AND v_cal_date < E.END_DT THEN 1 END),0) AS my_count
                         FROM        tbl_data E
                   WHERE cal_date = v_cal_date;
            v_cal_date := v_cal_date + (1/1440);
            intX := intX + 1;
            COMMIT;
        END LOOP;
    END;Edited by: Jason_S on Oct 21, 2009 9:00 AM -- i messed up the years/months .. fixed now
    Edited by: Jason_S on Oct 21, 2009 9:13 AM

  • Breakout table (fill table with matching data from another table)

    Hi
    I've been trying to study old discussions about breakout tables. I feel I'm close, but still no cigar :-)
    In plain english, I'm trying to autocreate rows with data on a table, based on matching values from another table. E.g. have a table to display all rows where type = AssetX
    I have attached a screenshot of my "master table" called Assets:
    I'm looking to prefill Asset name, Total from this table and populate a new table called e.g. Greenhouse
    Where I'd be adding more data (date, income, expense).
    Any help whould be greatly appreciated.
    Thanks!

    Hi,
    Here is a Sample Query.
    Update Emp A
    Set Sal = (Select Sal from emp b where
    a.empno = b.empno)
    where empno in (select empno from emp);
    Regards,
    Ganesh R
    null

  • 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

  • Problem creating a 'used sources' list based on EXIF data in InDesign CS5

    Hello everyone,
    I recently started to use InDesign CS5 to work on school projects. These projects regularly require us to have a list of sources, not only for citations and referenced work, but also for images. As I sometimes make quite long documents, keeping track of what image is where, and where I got it from, gets tedious.
    I had the idea of generating a caption based on EXIF data, which I'd move to the pasteboard, and group it with the image. The text in the caption has a seperate, numbered paragraph style. On one of the last pages, I generate a table of contents, which the numbered paragraph style selected. I chose to display it using another paragraph style, without page numbers.
    What I want to have as the end result is:
    Table of contents
    1. <Title>. <Author> (<Creation Date>). Retrieved <Date Placed> through <Description>
    The captions display correctly, as shown above in the body of the table of contents. The table of contents itself however, shows only the numbering in front of it, and not the variables.
    I already tried converting the live captions to static captions, but that doesn't work. Does anyone have an idea how to solve this?

    Hello everyone,
    I recently started to use InDesign CS5 to work on school projects. These projects regularly require us to have a list of sources, not only for citations and referenced work, but also for images. As I sometimes make quite long documents, keeping track of what image is where, and where I got it from, gets tedious.
    I had the idea of generating a caption based on EXIF data, which I'd move to the pasteboard, and group it with the image. The text in the caption has a seperate, numbered paragraph style. On one of the last pages, I generate a table of contents, which the numbered paragraph style selected. I chose to display it using another paragraph style, without page numbers.
    What I want to have as the end result is:
    Table of contents
    1. <Title>. <Author> (<Creation Date>). Retrieved <Date Placed> through <Description>
    The captions display correctly, as shown above in the body of the table of contents. The table of contents itself however, shows only the numbering in front of it, and not the variables.
    I already tried converting the live captions to static captions, but that doesn't work. Does anyone have an idea how to solve this?

  • Vendor Balance Report Day wise based on Posting date

    Hi Guru's,
    I am creating vendor balance reprot day wise based on posting date .
    In my report i want to show  TDS(With hold tax ) amount where can i get that field name how can retrive the data using bsik and bsak .
    I Donot want to display reversal documents in the displaying list .How can i remove reversal entries .
    Regards
    Nandan.

    Hi Nandan,
    check these tables:
    A399
    T059O
    T059ZT
    Regards,
    Santosh Kumar M

  • Receivable Aging Report for India based on Invoice Date

    We have a reporting/legal need for our India location to report the aging of their receivables based on the invoice date of the documents rather than the net due date.  Is there an existing report available that already does this?
    Currently when you use FBL5N and related aging reports RFDOPO10 etc. it calculates the arrears from the net due date.  They need to calculate the arrears from the document date.

    The report S_ALR_87012168 still does not allow me to choose that I want to calculate the arrears from the document date rather than the net due date:
    I guess what they really need to know is how old the receivables are based on the date they were created.
    As in the example below, current aging reports use the Net Due to calculate a days in arrears of 6 days (based on current date of 2008/11/05).
    Ty Doc. Date  Pstng Date Bline Date Net due dt Arrea
    RV 2008.09.30 2008.09.30 2008.09.30 2008.10.30     6
    What they need is the number of days in arrears based on the document date (2008.09.30) which would increase the numer of days the receivable has been open to 36.

  • R12: How to filter Open Item Revaluation Report based on GL Date

    Hi,
    Anybody know how to filter Open Item Revaluation Report based on GL Date from and GL Date to in R12?
    Since we just upgraded from 11.5.10 to 12.1.3 and found we cannot filter those report for specific date. It shown all data included the old data from 8 years ago also.
    We need to run the report only for specific date only. Please share with me if anyone know about this.
    Thanks.

    Pl do not post duplicates - R12: How to filter Open Item Revaluation Report based on GL Date

  • AR aging basing on Invoice date

    Currently client gets AR aging based on Due Date. For audit purpose they need AR Aging based on Invoice Date. During SAP implementation they were instructed to use document date as invoice date and generate a dump from FBL5N and do the aging. However this does not work for balancing items as the document date changes to the date on which the partial clearing of that item was done. This is not acceptable to auditors.
    Please help.
    Any useful answer will be rewarded with points.

    Hi
    Please try to use the field Baseline date for this purpose as this field will not be disturbed even when we do partial clearing of invoices.
    Reward points if found useful.
    Regards,
    K Lakshmanan

Maybe you are looking for