Year to Date query

SELECT T0.CardName, sum(T1.Price) [Year To Date], '0' [Previous] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.DocDate Between DATEADD(year,-1,GETDATE()) AND GETDATE() GROUP BY T0.CardName
UNION
SELECT T2.CardName, '0' [Year To Date], sum(T1.Price) [Previous] FROM OINV T2  INNER JOIN INV1 T1 ON T2.DocEntry = T1.DocEntry WHERE T2.DocDate Between DATEADD(year,-2,GETDATE()) AND DATEADD(year,-1,GETDATE()) GROUP BY T2.CardName
ORDER BY T0.CardName asc
Gives me, for example:
A    100      0
A     0        150
B     200     0
B     0        50
C    300      0
D     0         550
How would I go about joining them together into:
A    100    150
B    200    50
C    300    0
D    0       550
Thanks,
Jason

SELECT T1.CardName, sum([YearToDate]), sum(Previous)
FROM OINV T1, (
SELECT T0.CardName [BP], sum(T1.Price) [Year To Date], '0' [Previous] FROM OINV T0  INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry WHERE T0.DocDate Between DATEADD(year,-1,GETDATE()) AND GETDATE() GROUP BY T0.CardName
UNION
SELECT T2.CardName [BP], '0' [Year To Date], sum(T1.Price) [Previous] FROM OINV T2  INNER JOIN INV1 T1 ON T2.DocEntry = T1.DocEntry WHERE T2.DocDate Between DATEADD(year,-2,GETDATE()) AND DATEADD(year,-1,GETDATE()) GROUP BY T2.CardName
) as d(BP, YearToDate, Previous)
WHERE d.BP = T1.CardName
GROUP BY T1.CardName
ORDER BY T1.CardName
Solved.

Similar Messages

  • How to create a Year to Date Query when only Monthly values are in the data

    Hi SDN community,
    Is it possible to create a query by dragging in the fiscal year period characteristic , and any other required characteristics in the rows,
    and then use functionality to have columns of data that add up the previous periods. 
    ex.  the month of sept, = Jul + aug + sep
    i basically want to see 12 columns of Actuals,
    and then a trend line, to add up those columns.
    If we load up the data with a YTD time variant out of the system and load, then this is fine, but can we do it with the query and how.
    Thank you.
    Simon

    Hi,
    ex. the month of sept, = Jul + aug + sep
    Of course it is possible in Query,
    -->Create a formula on the key fig.
                   NoDim(<Key Fig Name>)
    -->in Property of that formula, in Calculation Tab
    -->Check the Cumulative Property
    -->Select Either Along Rows or Along Columns as per your requirement
    please give more details, so I can provide Full steps for that..
    Best regards
    Obaid

  • Are Cube organized materialized view with Year to Date calculated measure eligible for Query Rewrite

    Hi,
    Will appreciate if someone can help me with a question regarding Cube organized MV (OLAP).
    Does cube organized materialized view with calculated measures based on time series  Year to date, inception to date  eg.
    SUM(FCT_POSITION.BASE_REALIZED_PNL) OVER (HIERARCHY DIM_CALENDAR.CALENDAR BETWEEN UNBOUNDED PRECEDING AND CURRENT MEMBER WITHIN ANCESTOR AT DIMENSION LEVEL DIM_CALENDAR."YEAR")
    are eligible for query rewrites or these are considered advanced for query rewrite purposes.
    I was hoping to find an example with YTD window function on physical fact dim tables  with optimizer rewriting it to Cube Org. MV but not much success.
    Thanks in advance

    I dont think this is possible.
    (My own reasoning)
    Part of the reason query rewrite works for base measures only (not calc measures in olap like ytd would be) is due to the fact that the data is staged in olap but its lineage is understandable via the olap cube mappings. That dependency/source identification is lost when we build calculated measures in olap and i think its almost impossible for optimizer to understand the finer points relating to an olap calculation defined via olap calculation (olap dml or olap expression) and also match it with the equivalent calculation using relational sql expression. The difficulty may be because both the olap ytd as well as relational ytd defined via sum() over (partition by ... order by ...) have many non-standard variations of the same calculation/definition. E.g: You can choose to use or choose not to use the option relating to IGNORE NULLs within the sql analytic function. OLAP defn may use NASKIP or NASKIP2.
    I tried to search for query rewrite solutions for Inventory stock based calculations (aggregation along time=last value along time) and see if olap cube with cube aggregation option set to "Last non-na hierarchical value" works as an alternative to relational calculation. My experience has been that its not possible. You can do it relationally or you can do it via olap but your application needs to be aware of each and make the appropriate backend sql/call. In such cases, you cannot make olap (aw/cubes/dimensions) appear magically behind the scenes to fulfill the query execution while appearing to work relationally.
    HTH
    Shankar

  • Month-to-Date and Year-to-Date values in Query

    Hello experts,
    One of our BI reports has the following requirement: the user should be asked for the report date. After the user inputs the date, the report shows the key figures in three different "flavors": one is the values for that date, the second one is the cumulate values from the first day of the month of the report date to the report date itself, and the third is the cumulate values from the first day of the year of the report date to the report date itself.
      I created my report date variable based on 0CALDAY. Then I searched for SAP-exit variables that would help me achieve this, but could not really find any, except for 0P_ABO10, 0P_ABO11, 0P_ABO12 variables, all of them have as description "Start of Key Date Year". I tried creating a few selections in which the dates taken were defined as a range from each of these variables to the report date variable (for the year-to-date values), but I got the error "Variable 0P_ABO10 could not be substituted". I also got this error for the other two variables. And I could not find any SAP-exit variables like "Start of Key Date Month", in order to do the Month-to-Date part. My next try was to use the field "Key Date" with a variable in it, instead my own report date variable based on 0CALDAY, but it gave me the same errors.
    I searched the forums and found a few threads that looked useful, like
    First and Last day of month and
    1st day of month / 1st day of week variables
    However, they require some ABAP coding, and I do not know where to place the code (actually, I do not know where to work with ABAP code), and I also believe that I would have to do some changes to it.
    Any suggestions?

    Hi Pedro,
    You have to create customer exit in T_Code: CMOD
    1. Create a Z project
    2. Select RSR00001 as enhancement type.
    3. Go into include ZXRSRU01
    4. create a code like
    Here A is your variable based on 0calmonth with type customer exit and B is variable for 0calday.
    Try to write logic for your case taking this as example.
    WHEN 'A'.
        IF I_Step = 2.
          Loop at I_T_VAR_RANGE into L_T_VAR_RANGE where VNAM = 'B'.
            Concatenate L_T_VAR_RANGE-LOW(4) '001' into D1.
            Concatenate L_T_VAR_RANGE-LOW(4) '012' into D2.
            Clear L_S_Range.
            L_S_Range-low = D1.
            L_S_RANGE-high = D2.
            L_S_RANGE-sign = 'I'.
            L_S_RANGE-opt = 'BT'.
            Append L_S_Range to E_T_Range.
          ENDLOOP.
        ENDIF.
    If you want exact code I can help you in that.
    Thanks,
    Kams

  • Table for Year to date payments made to vendors

    Hi friends,
    I am generating one query, in which I have to show year to date payments made to vendors.
    can anyone tell me from which table and from which foield can I get this information.
    Please help.

    hi,
    GO to SE16 and select doc type wise , you will get a solution .
    i hope it helps you.
    regds,
    raman

  • Year to Date and Monthly totals

    I know that this is rather simplistic, but I'm new to Discoverer and need to set up a bunch of sales reports with MTD and YTD columns. I'm going to be using the same SQL query for many of my reports but customizing the reports to show sales by state, product line, etc.
    Is there a formula/function I can use in Discover for the Month to Date and Year to Date totals?
    Thanks,
    Joseph

    Hi Joseph
    You can use the analytic range SUM calculation for these. For the month to date, use the a PARTITION BY of month with a range of all the preceding rows in the partition up to and including the current row. For the year, you would simply change the PARTITION BY to be the year.
    Here are some examples drawn from my own database:
    I have the following items:
    ORDER_YEAR
    ORDER_MONTH
    ORDER_DATE
    SELLING_PRICE
    With these defined, the formula for month to date is:
    SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC ROWS UNBOUNDED PRECEDING)
    The formlua for year to date is:
    SUM(Selling Price SUM) OVER(PARTITION BY ORDER_YEAR  ORDER BY  ORDER_DATE ASC  ROWS  UNBOUNDED PRECEDING )
    Basically what we are doing is telling Discoverer to SUM the SELLING_PRICE, and you should be able to take these and adjust them for your own report.
    Let me take a look at the month to end and describe what is going on. Basically the PARTITION BY is defining a set of rows which are to be included. In this case it is all rows that have the same ORDER_MONTH. The ORDER BY clause tells Discoverer to place the items in order, with the oldest order first. The ROWS UNBOUNDED PRECEDING tells Discoverer to SUM all of the items within the set (within the PARTITION BY) from the oldest item (UNBOUNDED PRECEDING) to and including the current item. We could have added a BETWEEN clause too but that is implied. With a BETWEEN clause it would look like this:
    SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
    If you want the current row to be included with UNBOUNDED PRECEDING you don't need to explicitly name it because that is the default. Other options you could use are these:
    UNBOUNDED FOLLOWING - this SUMS to the end of the PARTITION
    ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING - you can guess that this will add all of the items, which you will rarely use because if you omit the ROWS command then this range between first and last is actually the default
    Rather than ROWS BETWEEN you can also say RANGE BETWEEN, like this:
    SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
    I hope this little dissertation on running totals helps.
    Best wishes
    Michael

  • Month and Year-To-Date Grouping

    Hello,
    I have 4 key figures.  For each of the key figures I need to display the value for the month and the value for the year-to-date.  Example, if the user selects October as the month the query should display only the totals for October and the totals from January to October.  The user does not want to see the totals for January, February, March and so on. 
    ........................Month of October.................Year-To-Date
    No. of Orders .................. 3,005..................... 22,950
    Order Value ..................190,000................ 5,900,000
    Canceled Orders .....................7........................... 60
    Value of Canceled Orders......700........................8000
    Can someone tell me how I go about doing that?

    Hello MIG,
    I guess you can create a structure for your key figures at the rows area of the query and a structure for your dates (e.g. fiscal periods) at the columns area. For your columns, you will need two restricted key figures. The first key fgure will be for your user's current month (e.g. Oct) -- this will be equal to fiscal year/period restricted by a user entry variable for the current month. The second key figure will be for your year to date KF (e.g. Jan to Oct) -- this will be equal to fiscal year/period restricted by a customer exit variable that computes for the date range between Jan and the user's current month. <b>OR</b> you can ask the user to input the initial date (should be defaulted to Jan 2006*) and the current month in a date range -- this will be an interval variable. Hope this helps.
    Juice

  • Extracting year and date

    I am working on the following query
    SELECT report_date, EXTRACT (MONTH FROM report_date) FROM program_details;
    SELECT a.customer_id, a.report_date as change_date
    FROM program_details AS a
    LEFT JOIN program_details AS b
    on a. customer_id = b. customer_id
    AND EXTRACT (MONTH FROM a.report_date) = EXTRACT (MONTH FROM b.report_date) - 1
    AND EXTRACT (YEAR FROM a.report_date) = EXTRACT (YEAR FROM b.rpt_date )
    WHERE a.code_status = 'Gold' and b.code_status = 'Plat'
    AND a.report_date >= '2007-12-01 00:00:00.0'
    AND a.report_date < '2009-01-01 00:00:00.0'
    I have a table with customer id, yyyy-mm-dd for many years , and status as gold silver or platinum. and I need to work out the month that the status changed, and return a field as year-month.
    I am trying to extract the year and date that a customer changed from gold to plat but I am not sure how date arithmetic works. I need to have output like : customer_id and year-month but I keep just getting month.
    I know this is vague, but if you could help with the part of the query that delivers year and month back that would be great.
    Thank you very much

    Hi,
      1  SELECT a.customer_id, to_char(a.report_date, 'yyyy-mm') as change_date
      2* FROM program_details a
    SQL> /
    CUSTOMER_ID CHANGE_
              1 2009-06Bartek

  • Using an expression in SSRS to display rolling 12 month and year to date volumes

    I need some help in writing an expression in SSRS. I have a table that contains date columns and rows that contain different types of data groups. (e.g. total number of items received during the month, total dollars for the month, etc.) I want to add two
    new columns to the end of the report that will display a rolling twelve month total for each of the different rows of data. Plus a column that would show year to date totals for the same rows.
    I was thinking I could accomplish this by adding expressions for each row in the new 'rolling twelve month' and 'YTD' columns in my report however, I'm not sure how to structure the expressions to achieve this.
    Here is an example of how my report currently looks. (I added a pipe delimeter in case the formatting changes once this is submitted.)
                             Jan-2014 | Feb-2014 | Mar-2014 | Apr-2014 | Rolling 12 mth | YTD
    Items received     100 | 35 | 45 | 12 | 192 | 192
    Dollars                $50.00 | $25.00 | $120.00 | $15.00 | $210.00 | $210.00
    Any guidance you can provide would be appreciated.
    Thank you  

    This example shows how to get what you need. It'll take modifying your query to add two cased columns onto the end.
    DECLARE @forumTable TABLE (periodYear INT, periodMonth INT, periodMonthName VARCHAR(12), periodDollars MONEY, periodItems INT)
    DECLARE @i INT = 0
    SET NOCOUNT ON
    WHILE @i < 24
    BEGIN
    INSERT INTO @forumTable (periodYear, periodMonth, periodMonthName, periodDollars, periodItems)
    VALUES (YEAR(DATEADD(MONTH,-@i,GETDATE())), Month(DATEADD(MONTH,-@i,GETDATE())), DATENAME(MONTH,DATEADD(MONTH,-@i,GETDATE())), 1000-@i, 100-@i)
    SET @i = @i+1
    END
    SET NOCOUNT OFF
    SELECT *,
    CASE WHEN CONVERT(VARCHAR,periodYear) + '-' + CONVERT(VARCHAR,periodMonth) + '-01' > DATEADD(MONTH,-12,GETDATE()) THEN periodItems ELSE 0 END AS ytdItems,
    CASE WHEN CONVERT(VARCHAR,periodYear) + '-' + CONVERT(VARCHAR,periodMonth) + '-01' > DATEADD(MONTH,-12,GETDATE()) THEN periodDollars ELSE 0 END AS ytdDollars
    FROM @forumTable

  • Year to Date using SAP variables

    I've run into a sticking point when trying to create a year to date calculation that works without user entry. The infocube is updated by finance each month (for the previous month) after the final adjustments are made. For this reason, when the query pulls YTD information, it should be cumulating from January 20XX to Current Month - 1.
    The first way that I tried was to use overlapping restrictions: Fiscal Year/Period < Current Fiscal Year/Period AND Fiscal Year = Current Fiscal Year. This worked very well until we reached January. Now the overlapping restrictions return no results since all previous months are not in the current fiscal year.
    I've also attempted using the SAP exit variable 0FYTLFP (Cumulated to Last Fiscal year Period) on Fiscal Year/Period. It is not working, and I assume it is because the last fiscal year period is falling into a different fiscal year. Using it today, the value I get is equal to the value for Jan 2007. The variable seems to first look up the first day of the current fiscal year, saves that as one end of the range, then goes to the previous month to get the other end of the range. I tried offsetting this variable by -1 and the value returned was equal to Dec 2006, but not YTD.
    I'm assuming it must be possible to use the standard SAP delivered objects to create a working YTD calculation that does not require manual entry and cumulates correctly through current period - 1. Does anyone have any suggestions?
    Thanks!

    Dear Adam,
    For Year to Date , We have created a Customer Exit , For working , Create a Variable for 0calday and populate that with from and to value ...to value would be Sy-datum and From value is year starting date. Hope it helps..
    Thanks,
    Krish

  • Vendor payments made year to date

    Hi Friends,
    I have to show the report to client which can give year to date payments made to all individual vendors.
    I have around 3000 vendors and I need to pull report for all of them
    Can you please tell me if there is any standadrd SAP report or settings that can provide me with these details?
    It doesnt need to be line item vise FBL1N is not useful.
    Please let me know
    Thanks

    Hi,
    Normally payments are booked via document type "KZ".
    You can execute thru fbl1n, and in the multiple selection choose Doc Type "KZ" and select all items till date.
    You can then as per your wish can create the sorting and subtotals.
    Also you can download in excel and do the further processing.
    There is one more suggestion:  You can create query on table BSAK in which all cleared vendor line items are stored.
    Hope this will help, if yes, please assign points.
    Regards,
    Harish

  • Date query to display in column

    Hi,
    I have a query which will list down the date for a year as below:
    Query:
    SELECT     TO_DATE ('01/01/2009','mm/dd/yyyy') + LEVEL - 1     AS dt
    FROM     dual
    CONNECT BY LEVEL <=
         1 +     TO_DATE ('12/31/2009','mm/dd/yyyy')
         -     TO_DATE ('01/01/2009','mm/dd/yyyy')
    Result:
    DT
    01-JAN-09
    02-JAN-09
    03-JAN-09
    04-JAN-09
    05-JAN-09
    31-DEC-09
    The result is listed in row. How can I change the query to list the result by column as below:
    01-JAN-09 02-JAN-09 03-JAN-09 04-JAN-09... 31-DEC-09
    Appreciate advise on this area.
    Thanks in advance.
    Cheers,
    SC

    Hi,
    In my understanding above solution should work in all version of Oracle 10g. Grant DBA to to SCOTT user and then connect to scott and try above solution. May be there is some rights problems. If not, then try following solution,
    SELECT SUBSTR (c, 2) emp_name
      FROM (SELECT     SYS_CONNECT_BY_PATH (ename, ' ') c, r
                  FROM (SELECT   ROWNUM ID, ename,
                                 RANK () OVER (ORDER BY ROWID DESC) r
                            FROM emp
                        ORDER BY ename)
            START WITH ID = 1
            CONNECT BY PRIOR ID = ID - 1)
    WHERE r = 1;
    please mark if it help you or correct
    Regards,
    Danish
    Edited by: Danish on Jul 28, 2009 10:41 AM

  • GROUP BY GROUPING SETS for a selected month and for year to date

    Below is a code example to demonstrate this question:
    declare @test table (ID int, Quantity int, Day date);
    insert into @test values
    (4, 500, '1/18/2014'),
    (4, 550, '1/28/2014'),
    (7, 600, '1/10/2014'),
    (7, 750, '1/11/2014'),
    (7, 800, '1/20/2014'),
    (1, 100, '1/2/2014'),
    (1, 125, '1/10/2014'),
    (8, 300, '1/7/2014'),
    (9, 200, '1/17/2014'),
    (9, 100, '1/22/2014'),
    (4, 900, '2/18/2014'),
    (4, 550, '2/28/2014'),
    (7, 600, '2/10/2014'),
    (7, 700, '2/11/2014'),
    (7, 800, '2/20/2014'),
    (1, 100, '2/2/2014'),
    (1, 150, '2/10/2014'),
    (8, 300, '2/7/2014'),
    (9, 200, '2/17/2014'),
    (9, 100, '2/22/2014'),
    (4, 500, '3/18/2014'),
    (4, 550, '3/28/2014'),
    (7, 600, '3/10/2014'),
    (7, 750, '3/11/2014'),
    (7, 800, '3/20/2014'),
    (1, 100, '3/2/2014'),
    (1, 325, '3/10/2014'),
    (8, 300, '3/7/2014'),
    (9, 200, '3/17/2014'),
    (9, 100, '3/22/2014'),
    (4, 500, '4/18/2014'),
    (4, 550, '4/28/2014'),
    (7, 100, '4/10/2014'),
    (7, 750, '4/11/2014'),
    (7, 800, '4/20/2014'),
    (1, 100, '4/2/2014'),
    (1, 325, '4/10/2014'),
    (8, 300, '4/7/2014'),
    (9, 200, '4/17/2014'),
    (9, 100, '4/22/2014'),
    (4, 500, '5/18/2014'),
    (4, 550, '5/28/2014'),
    (7, 600, '5/10/2014'),
    (7, 750, '5/11/2014'),
    (7, 50, '5/20/2014'),
    (1, 100, '5/2/2014'),
    (1, 325, '5/10/2014'),
    (8, 300, '5/7/2014'),
    (9, 200, '5/17/2014'),
    (9, 100, '5/22/2014');
    --detail
    select *
    from @test;
    --aggregation
    select
    TotalQuantity = sum(Quantity),
    [Month] = month(Day)
    from @test
    group by
    grouping sets
    (month(Day)),
    (year(Day))
    go
    This is the aggregation query result:
    However, the desired result is to return only two rows: one row for month 3 and the other row for year to date (in the picture above YTD is the row that appears with {null} in the Month column).  Is there a way to achieve this goal by modifying the
    sample code above?  The requirement is to only read the data once (do not want a solution that involves a UNION which implies reading the data twice).

    you can add required filters in having clause. Here is the query -
    select
    TotalQuantity = sum(Quantity),
    [Month] = month(Day)
    from @test
    group by
    grouping sets
    (month(Day)),
    (year(Day))
    having
    month(Day) = 3 or month(Day) is null;

  • Pl/sql Year to Date Function

    Dear All!
    Its very urgent task for me. i'm working on Oracle discoverer. i'm creating Project Year to Date report. i need one year to date function. i've only period name. The scnerio is this, in our company financial year is starting from (April to March i.e 01-April-2011 to 31-mar-2012). i need to apply YTD function on Period name. when any user select any period it will show from 01-apr-2011 to select mont. for example if user select Feb-12 then it must be from 01-apr-2011 to 29-feb-2012.
    Please this is urgent.. give Query for function. please
    Regards
    Ahmed....

    Hello,
    Can you put an example on apex.oracle.com and provide a link, it will be much easier to help you out?
    Regards,
    Carl
    blog : http://carlback.blogspot.com/
    apex examples : http://apex.oracle.com/pls/otn/f?p=11933:5

  • Roll up information for Year To Date

    Hello,
    I have some sales data as follows
    Item_Id Country_Id Region_ID Month_begin_date Quantity Amount
    s1 C1 r1 10/1/2008 20 2000.05
    s2 C1 r1 10/1/2008 100 4350.45
    s3 c2 r2 11/1/2008 50 3200.00
    s3 c1 r3 12/1/2008 102 5102.50
    s3 C2 r2 01/1/2009 35 1989.45
    s2 c1 r1 02/1/2009 56 2989.00
    s3 C3 r3 03/1/2009 29 1129.00
    s1 c3 r3 04/1/2009 455 3000.00
    s2 c2 r2 05/1/2009 123 2345.00
    s3 c2 r1 06/1/2009 40 1878.00
    s1 c2 r2 07/1/2009 65 1123.00
    s2 c2 r2 08/1/2009 100 1000.50
    s3 c3 c3 09/1/2009 191 2500.00
    s1 c2 r3 08/1/2009 299 3448.50
    s2 c3 r3 09/1/2009 432 5000.00
    s3 c1 r3 07/1/2009 175 4000.00
    here item_id,country_id,region_id,month_begin_date are together composite primary key...
    I want to get year to date (sum from the INITIAL date to sysdate) OF sum of quantity and sum of amounts to above data .
    I.E. Query should consider records until 7/1/2009
    and calculates sum of quntity and amount group by primary key fields...
    s1 C1 r1 10/1/2008 20 2000.05
    s2 C1 r1 10/1/2008 100 4350.45
    s3 c2 r2 11/1/2008 50 3200.00
    s3 c1 r3 12/1/2008 102 5102.50
    s3 C2 r2 01/1/2009 35 1989.45
    s2 c1 r1 02/1/2009 56 2989.00
    s3 C3 r3 03/1/2009 29 1129.00
    s1 c3 r3 04/1/2009 455 3000.00
    s2 c2 r2 05/1/2009 123 2345.00
    s3 c2 r1 06/1/2009 40 1878.00
    s1 c2 r2 07/1/2009 65 1123.00
    Thanks in advance...
    please help me out....

    Welcome to Forum!!
    SELECT
    Item_Id, Country_Id, Region_ID, Month_begin_date, SUM(Quantity) , SUM (Amount)
    FROM TABLE_NAME  --Add your table Name
    WHERE Month_begin_date < = SYSDATE  --will Reject records having date > sysdate
                                        --Remember the date comparision is bit tricky
    GROUP BY Item_Id, Country_Id, Region_ID, Month_begin_date1 min :: You want to GROUP the data on the basis of primary key: thats NOT logical
    Edited by: AJ99 on Jul 1, 2009 11:25 AM
    Edited by: AJ99 on Jul 1, 2009 11:29 AM

Maybe you are looking for

  • SRM 7.0  Unable to create PO - Classic Scenario.

    Hello, We are able to successfully create the below scenario. PR in ECC --> Get PR in SRM --> Start Collective processing -> Transfer to Central System (SC is created for the PR @ this time) --> Create RFx --> Rfx Response --> Create PO. (PO is creat

  • Excel from PC to iPad3 Numbers via iTunes not working

    I'm trying to add a couple excel spreadsheets to Numbers on an iPad3 from an XP machine via iTunes. The iTunes interface shows the files to be added to Numbers, but after I sync the device the files are not shown in iOS Numbers. I synced a pdf to Goo

  • Is there a place where I can submit a feature I'd like to see in FCPX?

    Hi all FCP editors out there!  I'm one of you and have been using FCP since it came out!  I recently cut several pieces in FCPX after studying the new App and I am working hard to embrace it.  I would like to know if I can submit a request for the fo

  • Add Operational Insights to Cloud Service during publish

    Hello, I have several Azure Services that I am already utilizing Application Insights on. What I would like to do is have Operational Insights added during the standard "Publish to Windows Azure" that I use from Visual Studio thereby removing the nee

  • Can't import any .psd files into after effects.

    Hello all. I was using CS5 master collection without issue, for a year.  Decided to upgrade to the CS6 master collection and that's when the problems began. For example, I can't import any .psd files into AE. All files are saved in RGB mode. The prev