Sample needed to query BW cube

I have two BW(BPC) cubes which are HANA enabled. I have heavy data processing logic currently in BADI and I am trying to push that into HANA DB layer, possibly as a SQL procedure.
1) Can someone point me to some sample/direction to achieve this
2) Any samples on how to query BW cubes and update them back
3) Is this the right forum for this question?
Appreciate any leads
~Dilkins

Hi,
Sorry coz i didn't tell you that I'm using Business Object, crystal report . Thru crystal report I want to extract data from BW cube or Query.  In other word, the database connection is from BW server.
I try to design the report thru OLAP report and extract multiple cube from BW, and i'm only can see one of the cube. The others cube I can't see. And then i try to retrieve data from existing cube that i can see, and i got this error 'Database Connector Error: 'Function module "/CRYSTAL/MDX_GET_STREAM_INFO" not found. Where can i get the function module.
Can you help me on this.
Thank you in advance for your help
Regards,
Akma

Similar Messages

  • Need MDX query to find something like date diff and Date Range for last 10 days

    Hi ,
    I need two Query .First Query for below;
    I have below data in table like.
    Cat      StartDate    EndDate     
    A    2000-01-01     2000-01-15   
    B    2000-01-02     2000-01-30    
    C    2000-01-01     2000-01-31    
    D    2000-02-01     2000-02-28    
    A    2000-01-10     2000-01-31    
    I need if Startdate and Date completes whole one month then set status =1 else  0 using MDX query.
    like this ;
    Cat      StartDate    EndDate       Status
    A    2000-01-01     2000-01-15    1
    B    2000-01-02     2000-01-30    0
    C    2000-01-01     2000-01-31    1
    D    2000-02-01     2000-02-28    1
    A    2000-01-10     2000-01-31    1
    In second query I need last 10 days from current days like;
    Now = 8/20/2014
    output will be ;
    8/20/2014
    8/19/2014
    8/18/2014
    8/17/2014
    8/16/2014
    8/15/2014
    8/14/2014
    8/13/2014
    8/12/2014
    8/11/2014
    8/10/2014
    Please help me .
    Thanks

    Hi Prajapati,
    In your scenario, you can use Properties and Datediff function to achieve your requirement. Since not know the structure of your cube, we cannot give you the esact query.
     I have tested it on the AdventureWorks cube, the query below is for you reference.
    WITH MEMBER [Measures].[StartDate]
    AS
    [Employee].[Employee Department].CURRENTMEMBER.PROPERTIES('Start Date')
    MEMBER [Measures].[WorkYear]
    AS
    DATEDIFF('yyyy',[Measures].[StartDate],NOW())
    MEMBER [Measures].[Status]
    AS
    IIF(DATEDIFF('yyyy',[Measures].[StartDate],NOW())>10,1,0)
    SELECT {[Measures].[StartDate],[Measures].[WorkYear],[Measures].[Status]} ON 0,
    [Employee].[Employee Department].[Employee].MEMBERS ON 1
    FROM [Adventure Works]
    Results
    Reference
    http://msdn.microsoft.com/en-us/library/ms144821.aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • Query on Cube jumps to Query on ODS ; Query on ODS takes Long time

    Hi All,
    Perormance Issue:  Query on Cube jumps to Query on ODS.
    Query on ODS taking long time.(JumpQuery)  
    Specific to ODS Query: When i have checked the Query on ODS(individually) also taking longer time
    Actually ODS contains quite huge data. Indexes already maintained.
    I have checked the RSRT- Execute SQL and Debug Option also. Indexes maintained Perfectly .
    Order of objects in ODS indexes are matching the order of Objects in SQL stat of RSRT Trans. Inspite of that taking long time.
    I have checked both the ways jumpquery aswellas individually .
    My question is when the query is jumping from cube to query on ODS how to check the performance, how the query is executing in background when switching over to the second query, Moreover calculated keyfigure has been used for jumping to the target query.
    How can query(ods query)  time is optimized or improve performance when jumping  from query on Cube ?
    can any body help?
    Rgds,
    C.V.
    Message was edited by:
            C.V. P

    What i understand is that you need to optimise the Query jumping time . But this will be very less compared to the time taken by the query on the ODS.
    Ideally you shouldnt be making a BEx Query on the ODS , as this takes a long time. What you can do is try executing the Bex Query on the ODS to find out as to where the issue lies. If this query is taking a long time , there is not muich that you can do here.

  • How to query a cube using SQL ?

    Hi I have a MOLAP cube say CubeA with dimensionA having Attribute A1 and dimensionB having attribute B1
    the measure of cube is M1.
    Any idea how i can query the cube using SQL dislaying both the dimensions with the measure interlinking them.
    I just need a general overview of how to sql query a cube .. I have the dimensions and sttributes and name of the cube but i ineed to know how to query it... I was given an example
    SELECT
    t.time_long_description,
    p.product_long_description,
    c.customer_long_description,
    f.sales,
    f.sales_ytd
    FROM
    time_calendar_view t,
    product_std_view p,
    customer_std_view c,
    sales_cube c
    WHERE
    t.dim_key = f.time
    AND p.dim_key = f.product
    AND c.dim_key = f.customer
    AND t.level_name = 'CALENDAR QUARTER'
    AND p.level_name = 'BRAND'
    AND c.level_name = 'STATE';
    but i cant understand it.. i cant figure out what are the dimensions and where are the attributes...
    Any idea would great...

    There's a nice tutorial here: http://st-curriculum.oracle.com/obe/db/11g/r1/olap/cube/querycubes.htm
    Here are a few basics. Note that the link between the dimensions is the join between the dimension or hierarchy views and the cube.
    * The primary key to every dimension and hierarchy view is DIM_KEY.
    * The primary key to the fact table is dim1, dim2, dim3, so all joins are between dim_keys and dim1, dim2, etc.
    * Dimension, hierarchy and cube views contain rows for both leaf (detail) and summary rows (that means cubes can return very, very large numbers of rows is you aren't careful)
    * You typically want to query for the aggregate level data rather than use SUM ... GROUP BY. Let the cube do the work and let it manage calculations.
    * Dimension views contain rows for all dimension member. hierarchy views contain rows for only members of the hierarchy.
    * You typically select one of the long or short description columns to display data within an application.
    Here's a commented version of your query:
    SELECT
    t.time_long_description, -- long descriptions
    p.product_long_description,
    c.customer_long_description,
    f.sales, --measures
    f.sales_ytd
    FROM
    time_calendar_view t, --hierarchy views
    product_std_view p,
    customer_std_view c,
    sales_cube c --cube view
    WHERE
    t.dim_key = f.time ; -- joins between hierarchy and cube views
    AND p.dim_key = f.product
    AND c.dim_key = f.customer
    AND t.level_name = 'CALENDAR QUARTER' -- Filters to ask for data at the quarter
    AND p.level_name = 'BRAND' -- brand
    AND c.level_name = 'STATE'; -- and state levels.
    You want to have a filter on every dimension to avoid return all rows in the fact table for that dimension (remember, the cube contains summary rows). If you want to drop a dimension from a query (e.g., you don't want product in the query, intending for the query to be the aggregate of all products), filter to an all/total level.
    e.g.,
    and p.level_name = 'ALL PRODUCTS'
    or
    and p.long_description = 'All Products'
    There are many variation of this query, but if you understand the basics you'll work your way there.
    And, never do a select count(*) from a cube. Doing so will select the entire cube, detail and summary data.

  • Need a query for monthly Report

    Hello All,
    I need a query for monthly report,
    comp_code
    emp_id
    dept_id
    work_day
    100
    A100
    MECH
    01/01/2013
    100
    A100
    MECH
    02/01/2013
    100
    A100
    MECH
    03/01/2013
    100
    A100
    MECH
    04/01/2013
    100
    A100
    MECH
    05/02/2013
    100
    A100
    MECH
    08/02/2013
    100
    A100
    MECH
    09/02/2013
    100
    A100
    MECH
    10/02/2013
    100
    A100
    MECH
    12/05/2013
    100
    A100
    MECH
    13/05/2013
    100
    A101
    CIV
    01/04/2013
    100
    A101
    CIV
    02/04/2013
    100
    A101
    CIV
    03/04/2013
    100
    A101
    CIV
    04/04/2013
    100
    A101
    CIV
    06/04/2013
    100
    A101
    CIV
    06/06/2013
    100
    A101
    CIV
    07/06/2013
    100
    A101
    CIV
    08/06/2013
    100
    A101
    CIV
    09/06/2013
    100
    A101
    CIV
    10/06/2013
    100
    A101
    CIV
    11/12/2013
    100
    A101
    CIV
    12/12/2013
    100
    A101
    CIV
    13/12/2013
    100
    A101
    CIV
    14/12/2013
        Dear friends this the sample table of my report.In which table has contain list of  employees with their working days(actual table has contain almost 5laks of records).
    suppose user choose the date between 01/01/2013 and 31/12/2013 then the result should be like this.
    comp_code
    emp_id
    dept_id
    month
    Total_work
    100
    A100
    MECH
    JANUARY
    4
    100
    A100
    MECH
    FEBRUARY
    2
    100
    A100
    MECH
    MARCH
    0
    100
    A100
    MECH
    APRIL
    0
    100
    A100
    MECH
    MAY
    2
    100
    A100
    MECH
    JUNE
    0
    100
    A100
    MECH
    JULY
    0
    100
    A100
    MECH
    AUGUST
    0
    100
    A100
    MECH
    SEPTEMBER
    0
    100
    A100
    MECH
    OCTOBER
    0
    100
    A100
    MECH
    NOVEMBER
    0
    100
    A100
    MECH
    DECEMBER
    0
    100
    A101
    CIV
    JANUARY
    0
    100
    A101
    CIV
    FEBRUARY
    0
    100
    A101
    CIV
    MARCH
    0
    100
    A101
    CIV
    APRIL
    5
    100
    A101
    CIV
    MAY
    0
    100
    A101
    CIV
    JUNE
    5
    100
    A101
    CIV
    JULY
    0
    100
    A101
    CIV
    AUGUST
    0
    100
    A101
    CIV
    SEPTEMBER
    0
    100
    A101
    CIV
    OCTOBER
    0
    100
    A101
    CIV
    NOVEMBER
    0
    100
    A101
    CIV
    DECEMBER
    4

    Hi,
    If you want the output to include months where no work was done (with 0 in the total_work column) then you need to outer-join a "table" that has one row per month, and make it a partitioned outer join:
    WITH  got_end_points   AS
       SELECT  TRUNC (MIN (work_day), 'MONTH')   AS first_month
       ,       TRUNC (MAX (work_day), 'MONTH')   AS last_month
       FROM    table_x
    ,   all_months   AS
       SELECT  ADD_MONTHS (first_month, LEVEL - 1)   AS a_month
       ,       ADD_MONTHS (first_month, LEVEL)       AS next_month
       FROM    got_end_points
       CONNECT BY  LEVEL <= 1 + MONTHS_BETWEEN (last_month, first_month)
    SELECT    t.comp_code
    ,         t.emp_id
    ,         t.dept_id
    ,         m.a_month
    ,         COUNT (t.work_day) AS total_work
    FROM             all_months  m
    LEFT OUTER JOIN  table_x     t  PARTITION BY (t.comp_code, t.emp_id, t.ept_id)
                                    ON   t.work_day  >= a.a_month
                                    AND  t.work_day  <  a.next_month
    GROUP BY  t.comp_code
    ,         t.emp_id
    ,         t.dept_id
    ,         m.a_month
    ORDER BY  t.comp_code
    ,         t.emp_id
    ,         t.dept_id
    ,         m.a_month
    As posted, this include every month that is actually in the table.  You can change the first sub-query if you want to enter first and last months.
    I hope this answers your question.
    If not, post  a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Point out where the query above is giving the wrong results, and explain, using specific examples, how you get the correct results from the given data in those places.  If you changed the query at all, post your code.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Help needed in Query

    I have one table Prd_mst, I need a query or function where whenever i pass the child_id into query or function i get the Parent_id of that
    example Data is below :-
    P_ID,P_NAME,C_ID
    null,Computer,1
    1,KeyBoard,2
    1,Mouse,3
    1,Mother Board,4
    3,Scroll Mouse,5
    3,Optical Scroll Mouse,6
    3,Fibre Scroll Mouse,7
    2,Multimedia Key Board,8
    2,Cordless Key Board,10
    2,Normal Key Board,9
    4,586 Mother Board,13
    4,386 Mother Board,11
    4,486 Mother Board,12
    4,P1 Mother Board,14
    4,P2 Mother Board,15
    4,P3 Mother Board,16
    4,P4 Mother Board,17
    14,533 Mhtz P1 CPU,19
    14,433 Mhtz P1 CPU,18
    19,533 Mhtz P1 CPU With 100Mhtz BUS,20
    19,533 Mhtz P1 CPU With 133Mhtz BUS,21
    18,433 Mhtz P1 CPU With 100Mhtz BUS,22
    So when ever i put the child id as 22 i should get the 14
    So when ever i put the child id as 21 i should get the 14
    So when ever i put the child id as 9 i should get the 1
    So when ever i put the child id as 15 i should get the 1
    So when ever i put the child id as 5 i should get the 1
    So when ever i put the child id as 3 i should get the null
    So when ever i put the child id as 14 i should get the 1.
    Please help me......
    There is one complex requirement in matrix format.
    Need P_ID , P_NAME , Count( child records)
    P_(nth), P_NAME(nth), Count(child record) nth times.
    Child is again the parent of some child.
    Report is needed for audit purpose.
    Message was edited by: Sandeep Sharma
    Sandeep Sharma

    SQL> CREATE TABLE SANDEEP(P_ID NUMBER,P_NAME VARCHAR2(100),C_ID NUMBER);
    Table created.
    SQL> INSERT INTO SANDEEP VALUES(null,'Computer',1);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(1,'KeyBoard',2);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(1,'Mouse',3);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(1,'Mother Board',4);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(3,'Scroll Mouse',5);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(3,'Optical Scroll Mouse',6);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(3,'Fibre Scroll Mouse',7);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(2,'Multimedia Key Board',8);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(2,'Cordless Key Board',10);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(2,'Normal Key Board',9);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(4,'586 Mother Board',13);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(4,'386 Mother Board',11);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(4,'486 Mother Board',12);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(4,'P1 Mother Board',14);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(4,'P2 Mother Board',15);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(4,'P3 Mother Board',16);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(4,'P4 Mother Board',17);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(14,'533 Mhtz P1 CPU',19);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(14,'433 Mhtz P1 CPU',18);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(19,'533 Mhtz P1 CPU With 100Mhtz BUS',20);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(19,'533 Mhtz P1 CPU With 133Mhtz BUS',21);
    1 row created.
    SQL> INSERT INTO SANDEEP VALUES(18,'433 Mhtz P1 CPU With 100Mhtz BUS',22);
    1 row created.
    SQL> COMMIT;
    Commit complete.
    SQL> set null null
    SQL> SELECT P_ID
      2    FROM SANDEEP
      3     WHERE LEVEL = 2
      4     START WITH C_ID = &1
      5     CONNECT BY C_ID = PRIOR P_ID;
    Enter value for 1: 22
    old   4:    START WITH C_ID = &1
    new   4:    START WITH C_ID = 22
          P_ID
            14
    SQL> /
    Enter value for 1: 21
    old   4:    START WITH C_ID = &1
    new   4:    START WITH C_ID = 21
          P_ID
            14
    SQL> /
    Enter value for 1: 9
    old   4:    START WITH C_ID = &1
    new   4:    START WITH C_ID = 9
          P_ID
             1
    SQL> /
    Enter value for 1: 15
    old   4:    START WITH C_ID = &1
    new   4:    START WITH C_ID = 15
          P_ID
             1
    SQL> /
    Enter value for 1: 5
    old   4:    START WITH C_ID = &1
    new   4:    START WITH C_ID = 5
          P_ID
             1
    SQL> /
    Enter value for 1: 3
    old   4:    START WITH C_ID = &1
    new   4:    START WITH C_ID = 3
          P_ID
    null
    SQL> /
    Enter value for 1: 14
    old   4:    START WITH C_ID = &1
    new   4:    START WITH C_ID = 14
          P_ID
             1
    SQL> SY.

  • Java.sql.SqlRecoverableException error while querying the cube

    Hi
    I get the following error when I try to query the cube from a Java program
    java.sql.SqlRecoverableException: no more data to read from the socket.
    This error occurs sometimes and sometimes it does not occur.
    We observed that if many people simultaneously try to query the cube the error crops up.
    Is this a bug or is there a solution or a method to deal with this sort of situation

    That sounds like the connection to the database is not there, or was dropped. Check that you are not maxed out on the number of processes.

  • I need a query to get all the values of taxes from the year 2008

    I have 2 tables in oracle 10.2.0.1
    sm_coaster_bills(
    id_coaster_bills number, (pk)
    id_coaster number, (fk from table sm_coasters)
    period varchar2(6), (JANMAR or APRJUN or JULSEP or OCTDEC (months of trimenster))
    year varchar2(4), (year when the bill was generated)
    value (the value of the debt)
    expiration date, (date of expiration of the payment)
    paid varchar2(1) (Y or N paid or not)
    and
    re_interests(
    id_interests number, (pk)
    value number, (the interest in a specific year)
    type varchar2(3), 'specify if the interest is anual or trimestral'
    period number, (1 or 2 or 3 or 4 depending of the trimester )
    year date, (day of the current interest ))
    the expirtation date is the last day when yyou can pay after thar the bill start to charge interests from the first month of the trimester
    The value of interests change year by year.
    I need a query or a function maybe a procedure that returns the total value of the bill changing the interest charged year after year.
    i mean this is a record of table sm_coaster bills
    (1, 7, 'OCTDEC', '2011', 321.21, 15/10/2011, N) this is a coaster bill not paid since october 2011 acquired in the period October-December
    and this are records from re_interests
    1, 12.3, 1, TRI, 2009
    2, 12.3, 2, TRI, 2009
    3, 12.3, 3, TRI, 2009
    4, 12.3, 4, TRI, 2009
    5, 23.0 0, ANU, 2009
    6, 13.5, 1, TRI, 2010
    7, 13.5, 2, TRI, 2010
    8, 13.5, 3, TRI, 2010
    9, 13.5, 4, TRI, 2010
    10, 24, 0, ANU, 2010
    11, 14.5, 1,TRI, 2011
    12, 14.5, 2, TRI, 2011
    13, 14.5, 3, TRI, 2011
    14, 14.5, 4, TRI, 2011
    15, 25, 0, ANU, 2011
    16, 15.5, 1, TRI, 2012
    16, 15.5, 2, TRI, 2012
    16, 15.5, 3, TRI, 2012
    for exaple if the license was bought on period JANMAR(january - march) year 2012 then the result should be
    320 multiplied for the interest of that trimester again multiplied for the interest of the next trimester APRJUN and the interest of the actual trimester
    value janmar aprjun julsep
    320* 1.135 * 1.135 * 1.135
    but if the bill was made on any trimester of any other year in the past then
    $320 should be multiplied for the anual interest of those years
    for exaple if the license was bought on period APRJUN(april - june) year 2009 then the result should be
    value 2009 2010 2011 janmar aprjun julsep
    320 * 1.23 * 1.24 * 1.25 * 1.135 * 1.135 * 1.135
    I want a procedure or a function that takes all values selecting all those interests year by year or trimestral whatever the case
    Edited by: mbarquet on 08/08/2012 08:04 PM

    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (8, 30, 1, 11.97, 11.97, 5.99, '2007', 'JULSEP', to_date('30-09-2007 23:59:59', 'dd-mm-yyyy hh24:mi:ss'), 1, 35.91, 0, 0, 0, 0, 1, 35.91, 0, 0, 0, 0, 0, 0, 71.82, null, 'A', to_date('27-08-2007 08:58:28', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('04-09-2007 12:33:17', 'dd-mm-yyyy hh24:mi:ss'), 'JDELGADO');
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (2323, 30, 1, 14.04, 14.04, 7.03, '2010', 'ABRJUN', to_date('08-05-2010 14:54:40', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 0, 0, 84.24, null, 'A', to_date('08-04-2010 14:51:25', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('03-05-2010 15:45:30', 'dd-mm-yyyy hh24:mi:ss'), 'LTAPIA');
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (2467, 394, 0, 14.04, 14.04, 7.03, '2010', 'ABRJUN', to_date('08-05-2010 14:55:19', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 84.24, null, 'A', to_date('08-04-2010 14:52:04', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (2541, 30, 1, 14.04, 14.04, 7.03, '2010', 'JULSEP', to_date('15-08-2010 10:06:42', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 0, 0, 84.24, null, 'A', to_date('16-07-2010 10:01:41', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('27-07-2010 11:05:15', 'dd-mm-yyyy hh24:mi:ss'), 'LTAPIA');
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (2102, 30, 1, 14.04, 14.04, 7.03, '2010', 'ENEMAR', to_date('18-02-2010 10:33:28', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 0, 0, 84.24, null, 'A', to_date('19-01-2010 10:38:53', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('01-02-2010 09:34:43', 'dd-mm-yyyy hh24:mi:ss'), 'LAGARCIA');
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (2262, 394, 0, 14.04, 14.04, 7.03, '2010', 'ENEMAR', to_date('18-02-2010 10:34:09', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 84.24, null, 'A', to_date('19-01-2010 10:39:33', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (2666, 394, 0, 14.04, 14.04, 7.03, '2010', 'JULSEP', to_date('15-08-2010 10:07:20', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 84.24, null, 'A', to_date('16-07-2010 10:02:20', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (2726, 30, 1, 14.04, 14.04, 7.03, '2010', 'OCTDIC', to_date('13-11-2010 09:46:45', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 0, 0, 84.24, null, 'A', to_date('14-10-2010 09:40:04', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('04-11-2010 10:28:29', 'dd-mm-yyyy hh24:mi:ss'), 'MSANTOS');
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (2865, 394, 0, 14.04, 14.04, 7.03, '2010', 'OCTDIC', to_date('13-11-2010 09:47:25', 'dd-mm-yyyy hh24:mi:ss'), 1, 42.12, 0, 0, 0, 0, 0, 0, 1, 42.12, 0, 0, 0, 0, 84.24, null, 'A', to_date('14-10-2010 09:40:44', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (2943, 30, 1, 14.51, 14.51, 7.26, '2011', 'ENEMAR', to_date('18-02-2011 09:35:09', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 0, 0, 87.06, null, 'A', to_date('19-01-2011 09:23:00', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('31-01-2011 15:35:02', 'dd-mm-yyyy hh24:mi:ss'), 'MSANTOS');
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (3322, 30, 1, 14.51, 14.51, 7.26, '2011', 'JULSEP', to_date('13-08-2011 08:36:38', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 0, 0, 87.06, null, 'A', to_date('14-07-2011 08:31:12', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('21-07-2011 12:02:17', 'dd-mm-yyyy hh24:mi:ss'), 'ASAGASTI');
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (3431, 394, 0, 14.51, 14.51, 7.26, '2011', 'JULSEP', to_date('13-08-2011 08:37:16', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 87.06, null, 'A', to_date('14-07-2011 08:31:49', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (3563, 30, 2, 14.51, 14.51, 7.26, '2011', 'OCTDIC', to_date('02-11-2011 08:31:37', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 0, 0, 87.06, null, 'A', to_date('03-10-2011 08:25:50', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('27-10-2011 11:04:39', 'dd-mm-yyyy hh24:mi:ss'), 'ASAGASTI');
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (3058, 394, 0, 14.51, 14.51, 7.26, '2011', 'ENEMAR', to_date('18-02-2011 09:35:44', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 87.06, null, 'A', to_date('19-01-2011 09:23:35', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (3122, 30, 1, 14.51, 14.51, 7.26, '2011', 'ABRJUN', to_date('21-05-2011 10:31:57', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 0, 0, 87.06, null, 'A', to_date('21-04-2011 10:22:14', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('27-04-2011 12:19:40', 'dd-mm-yyyy hh24:mi:ss'), 'LTAPIA');
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (3230, 394, 0, 14.51, 14.51, 7.26, '2011', 'ABRJUN', to_date('21-05-2011 10:32:40', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 87.06, null, 'A', to_date('21-04-2011 10:22:56', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (3743, 30, 1, 15.3, 15.3, 7.65, '2012', 'ENEMAR', to_date('17-02-2012 10:43:42', 'dd-mm-yyyy hh24:mi:ss'), 1, 45.9, 0, 0, 0, 0, 1, 45.9, 0, 0, 0, 0, 0, 0, 91.8, null, 'A', to_date('18-01-2012 10:30:30', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('27-02-2012 16:35:35', 'dd-mm-yyyy hh24:mi:ss'), 'MGUERRA');
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (3853, 394, 0, 15.3, 15.3, 7.65, '2012', 'ENEMAR', to_date('17-02-2012 10:44:15', 'dd-mm-yyyy hh24:mi:ss'), 1, 45.9, 0, 0, 0, 0, 0, 0, 1, 45.9, 0, 0, 0, 0, 91.8, null, 'A', to_date('18-01-2012 10:31:02', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (3942, 30, 1, 15.3, 15.3, 7.65, '2012', 'ABRJUN', to_date('16-05-2012 16:38:19', 'dd-mm-yyyy hh24:mi:ss'), 1, 45.9, 0, 0, 0, 0, 1, 45.9, 0, 0, 0, 0, 0, 0, 91.8, null, 'A', to_date('16-04-2012 16:31:43', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('16-05-2012 16:06:51', 'dd-mm-yyyy hh24:mi:ss'), 'ASAGASTI');
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (4180, 30, 1, 15.3, 15.3, 7.65, '2012', 'JULSEP', to_date('09-08-2012 18:10:47', 'dd-mm-yyyy hh24:mi:ss'), 1, 45.9, 0, 0, 0, 0, 1, 45.9, 0, 0, 0, 0, 0, 0, 91.8, null, 'A', to_date('10-07-2012 17:55:09', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', to_date('16-07-2012 15:30:30', 'dd-mm-yyyy hh24:mi:ss'), 'NAGUIRRE');
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (4065, 394, 0, 15.3, 15.3, 7.65, '2012', 'ABRJUN', to_date('16-05-2012 16:38:53', 'dd-mm-yyyy hh24:mi:ss'), 1, 45.9, 0, 0, 0, 0, 0, 0, 1, 45.9, 0, 0, 0, 0, 91.8, null, 'A', to_date('16-04-2012 16:32:17', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (3673, 394, 0, 14.51, 14.51, 7.26, '2011', 'OCTDIC', to_date('02-11-2011 08:32:16', 'dd-mm-yyyy hh24:mi:ss'), 1, 43.53, 0, 0, 0, 0, 0, 0, 1, 43.53, 0, 0, 0, 0, 87.06, null, 'A', to_date('03-10-2011 08:26:29', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
    insert into SM_COSTERA_PLANILLAS (ID_ESTACION_COSTERA_PLANILLA, ID_ESTACION_COSTERA, ID_FACTURA, VALOR_VHF, VALOR_HF, VALOR_MF, ANIO_PLANILLA, PERIODO_PLANILLA, FECHA_CADUCIDAD, CANALES_VHF_COSTERA, VALOR_CANALES_VHF_COSTERA, CANALES_HF_COSTERA, VALOR_CANALES_HF_COSTERA, CANALES_MF_COSTERA, VALOR_CANALES_MF_COSTERA, PORTATILES_COSTERA, VALOR_PORTATILES_COSTERA, NAVES_CORRESPONSALES, VALOR_CANAL_VHF_COSTERA_NAVES, VALOR_CANALES_HF_COSTERA_NAVES, VALOR_CANALES_MF_COSTERA_NAVES, PORTATILES_COSTERA_NAVES, VALOR_PORTATILES_COSTERA_NAVES, TOTAL_PLANILLA, OBSERVACIONES, ESTADO, FECHA_INGRESO, ID_USUARIO_INGRESO, FECHA_MODIFICACION, ID_USUARIO_MODIFICACION)
    values (4284, 394, 0, 15.3, 15.3, 7.65, '2012', 'JULSEP', to_date('09-08-2012 18:11:21', 'dd-mm-yyyy hh24:mi:ss'), 1, 45.9, 0, 0, 0, 0, 0, 0, 1, 45.9, 0, 0, 0, 0, 91.8, null, 'A', to_date('10-07-2012 17:55:43', 'dd-mm-yyyy hh24:mi:ss'), 'DMENDOZA', null, null);
    now for expample the registry from sm_costeras _planillas with id 4284 has a bill on julsep of 2012 that does not need to be charge
    the registry 3673 bill is on octdic of 2011 so as it is from the las year it charges the anual income for this year %12.78 plus the income of this year's trimesters
    if the registry is from 2009 the charge will be the incom of year 2009 plus 2010 plus2011 and the income of this year's trimesters
    the incomes charged on the value of the bill is complete y the expiration date is done then the bill of the trimester is complete also y the bill was on 30 dec of any year the bill is charge with the full year income even if its just for 2 days

  • Need Select  Query

    hi,
       Need Select  Query for this...
    12.     Check if the document category TVLK-VBTYP = ‘7’ where TVLK-LFART = LIKP-LFART (Delivery Type) then this is and Inbound Delivery for a purchase order.
    13.     Check the value of field Shipment External ID#1 (VTTK-EXTI1) is not initial then check the BOL Data Format. If not VICSBOL then set the variable LI_INBVICS = ‘N’. and  assign Shipment External ID#1 to Shipment External ID#2 i. e VTTK-EXTI2 = VTTK-EXTI1. and  Check the TMS  BOL Format. If VICSBOL then set LI_INBVICS = ‘Y’ .

    Hi,
    1)
    IF TVLK-VBTYP = ‘7’ and TVLK-LFART = LIKP-LFART.
    Inbound Is for a Purchase order.
    ELSE.
    Inbound Is not for a Purchase order.
    Endif.
    2)
    IF not VTTK-EXTI1 is initial.
    IF BOL DATA <> VICSBOL.
    LI_INBVICS = ‘N’.
    VTTK-EXTI2 = VTTK-EXTI1
    else if BOL DATA <> VICSBOL.
    LI_INBVICS = ‘Y’
    Endif.
    endif.
    endif.

  • I need a query

    Hi
    I've a table with 3(THREE)columns like the following structure:
    desc acc
    Name Null? Type
    MCODE NOT NULL NUMBER(2)
    TYPE CHAR(1)
    BALANCE NUMBER(14,2)
    Select * from acc
    MCODE TYPE BALANCE
    10 I 0
    11 L 0
    12 E 0
    12 L 0
    13 L 0
    14 L 0
    15 L 0
    16 E 154689718
    16 I 11244750
    16 L -11232000
    16 R 234178693
    17 L 0
    18 L 0
    13 rows selected.
    Pls Look at the above query that each ID(MCODE) may 4(four) TYPE ( E,I,L,R) and no more than these But each ID(MCODE) may have TYPE : 1 ( E or I or L or R) ,2 ( E,I or L,R or E,L or I,R ) ,3 (...., ...., ...,or ...,...,...).
    Now I need a query That BALANCE will be group by each MCODE base of clmn TYPE which result will be as follows:
    MCODE BALANCE
    10 ((I) + (R)) - ((E) + abs(L)) Where I= 11244750, R= 234178693
    11 ((I) + (R)) - ((E) + abs(L)) E= 154689718, L= -11232000
    12 ((I) + (R)) - ((E) + abs(L))
    13 ((I) + (R)) - ((E) + abs(L))
    14 ((I) + (R)) - ((E) + abs(L))
    15 ((I) + (R)) - ((E) + abs(L))
    16 ((I) + (R)) - ((E) + abs(L))
    17 ((I) + (R)) - ((E) + abs(L))
    18 ((I) + (R)) - ((E) + abs(L))
    how can it be done in a single oracle query can anyone help me
    Regards
    Alamgir Hossain
    Message was edited by:
    user628107
    Message was edited by:
    user628107
    Message was edited by:
    user628107

    Dear Mr. damorgan
    I respect your previous message. what you mean by honest attempt I don't know. As far we know all are respectable IT professionals in this forum. So we couldn’t expect like that answer from you.
    If you think, that is school work Pls prove yourself. I again post the problem with script specially for your kind attention.
    how can it be done in a single oracle query
    Create table acc(     
    MCODE     NUMBER(2) NOT NULL
    ,TYPE     CHAR(1)
    ,BALANCE     NUMBER(14,2)
    Insert into acc values(11,'L',0);
    Insert into acc values(12,'E',76000);
    Insert into acc values(12,'L',-4500);
    Insert into acc values(13,'L',0);
    Insert into acc values(14,'L',-5000);
    Insert into acc values(15,'L',0);
    Insert into acc values(16,'I',11244750);
    Insert into acc values(16,'E',154689718);
    Insert into acc values(16,'L',-11232000);
    Insert into acc values(16,'R',234178693);
    Insert into acc values(17,'L',0);
    Insert into acc values(18,'L',0);
    Select * from acc
    MCODE TYPE BALANCE
    11 L 0
    12 E 76000
    12 L -4500
    13 L 0
    14 L -5000
    15 L 0
    16 I 11244750
    16 E 154689718
    16 L -11232000
    16 R 234178693
    17 L 0
    18 L 0
    Pls Look at the above query that each ID(MCODE) may 4(four) TYPE ( E,I,L,R) and no more than these But each ID(MCODE) may have atleast TYPE : 1 ( E or I or L or R) OR 2 ( E,I or L,R or E,L or I,R ) OR 3 (...., ...., ...,or ...,...,...).
    Now I need a query That BALANCE will be group by each MCODE base of clmn TYPE which query result will be as follows :
    ( balance = ((I) + (R)) - ((E) + abs(L)))
    Where I= 11244750, R= 234178693
    E= 154689718, L= -11232000
    MCODE BALANCE
    10           0
    11          0
    12          -80500
    13          0
    14          -5000
    15          0      
    16          79501725
    17          0
    18      0
    how can it be done in a single oracle query

  • Need sql query to import from excel sheet

    Hey , i need sql query to import from excel sheet.
    i work in a company where i need to daily update the data from excel sheet.
    if i get a shortcut method i ill be very thank full to you guys to reduce my work upto 10 %.

    any query which can inert from excel file?
    Sort of. Certainly not anything as simple as what you seem to hope for. Check out this very good PHP class:
    PHPExcel - Home

  • Need a query to do row to column transformation

    SELECT friday_date FROM t2;Table Data:
    1/2/2009
    1/9/2009
    1/16/2009.......
    I need a query to get the output in below fashion
    Column
    1/2/2009,1/9/2009,1/16/2009
    I tried PIVOT and TRANSPOSE, cannot do this. I believe because it is a date,may be.
    I tried below code also, but CONNECT_BY_ISLEAF wont work on "ORA-00904: "CONNECT_BY_ISLEAF": invalid identifier"
    SELECT ltrim(sys_connect_by_path(FRIDAY_DATE,','),',') FRIDAY_DATE
           FROM (
            SELECT row_number() OVER(ORDER BY FRIDAY_DATE) rno,
                   FRIDAY_DATE
              FROM t2
          WHERE CONNECT_BY_ISLEAF = '1'
          start WITH rno = '1'
        connect BY rno = PRIOR rno+1;Thank You

    SQL>  WITH t2 AS (      SELECT TO_CHAR (
                                              NEXT_DAY (
                                                   DATE '2009-01-01' + (LEVEL - 1) * 7,
                                                   'friday'
                                              'mm/dd/yyyy'
                                              friday_date
                                  FROM DUAL
                        CONNECT BY LEVEL <= (DATE '2009-12-31' - DATE '2009-01-01') / 7)
    SELECT RTRIM (
                    XMLAGG (XMLELEMENT (
                                       e,
                                       friday_date || ','
                                  )).EXTRACT ('//text()'),
                    COLUMN_VALUE
      FROM t2
    COLUMN_VALUE                                                                   
    01/02/2009,01/09/2009,01/16/2009,01/23/2009,01/30/2009,02/06/2009,02/13/2009,02/
    20/2009,02/27/2009,03/06/2009,03/13/2009,03/20/2009,03/27/2009,04/03/2009,04/10/
    2009,04/17/2009,04/24/2009,05/01/2009,05/08/2009,05/15/2009,05/22/2009,05/29/200
    9,06/05/2009,06/12/2009,06/19/2009,06/26/2009,07/03/2009,07/10/2009,07/17/2009,0
    7/24/2009,07/31/2009,08/07/2009,08/14/2009,08/21/2009,08/28/2009,09/04/2009,09/1
    1/2009,09/18/2009,09/25/2009,10/02/2009,10/09/2009,10/16/2009,10/23/2009,10/30/2
    009,11/06/2009,11/13/2009,11/20/2009,11/27/2009,12/04/2009,12/11/2009,12/18/2009
    ,12/25/2009                                                                    
    1 row selected.

  • Need a query to update the inventory item to non inventory item

    Dear all,
            I need a query which should update the Inventory to Non - Inventory Item.

    Hi,
    You need to freeze the inventory by click inactive tick box. This will prevent users to use the inventory.
    The inventory posting lists will still exists as an inventory's transaction history for auditor if the inventory have had transactions.
    To empty the warehouse, just perform good issue and use inventory decrease account. After the warehouse has been empty, create similar inventory item by right click --> select duplicate. Create new item code and in the tab remarks, just write this non inventory item was ever inventory item with code e.g. xxxx.
    if you want to recover the stock, just create new item and then receive the stock into warehouse using Good receipt. use the same account code with account code used in the good issue.
    JimM
    PS.
    Do not use sql statement to update B1 database. No SAP support provided afterwards.

  • Need a Query to update....below are requirements

    Hi,
    I need a query to update table xx_cc_audit. below are requirements.
    In xx_cc_audit I have more than 1000 rows. In this table Column - contract_number is inserted as null for some rows.
    I need a query to update this xx_cc_audit table which will replace null contract numbers with correct ones.
    In table xx_cc_audit I have column - instance_id which is not null and not unique.(duplicate instance id's can be there).
    With this instance_id i can get the contract_number from other table okc_k_headers_b .
    I need a query to update xx_cc_audit table.
    Presently what I'm doing :
    Select XS.instance_id
    FROM cs_incidents_all_b CS,xx_cc_audit XS
    where XS.contract_number is null
    AND XS.SR_NUMBER = CS.incident_number
    AND XS.ACTIVITY_TYPE = 'TROUBLESHOOTING';
    Note : The above query can give duplicate instance_id.
    Say, above query results in 100rows.
    I will copy any 1 instance_id in a paper and then pass it to below query.
    SELECT contract_number
    FROM okc_k_headers_b
    WHERE id = (SELECT MAX(dnz_chr_id)
    FROM okc_k_items
    WHERE object1_id1 = TO_CHAR(144849056) --instance_id
    AND jtot_object1_code = 'OKX_CUSTPROD'
    AND object1_id2 = '#'
    AND chr_id IS NOT NULL);
    I'll get contract_number.
    then i'll update xx_cc_audit table as below.
    update      xx_cc_audit set contract_number = 1223464789 -- which i got as a result of above query
    where contract_number is null
    and instance_id = 144849056     --this i copied from paper, as mentioned above     ;
    this will update my table.
    I have more than 1000rows, so i need a query which will update 1000rows in 1 shot.
    Please help me.
    Thanks!...
    Edited by: Kiran Sanga on Jul 20, 2009 2:15 AM

    OK, so that means a maximum of 10 distinct IDs in okc_k_headers_b can be matched with xx_cc_audit xca.
    That's a data issue for yourself that you'll need to work out, i.e, are you being too restrictive in any of the subqueries, particularly this one:
    WHERE id = (
        SELECT MAX(dnz_chr_id)
          FROM okc_k_items
        WHERE object1_id1 IN (
          Select XS.instance_id
          FROM cs_incidents_all_b CS,xx_cc_audit XS
          where XS.contract_number is null
            AND XS.SR_NUMBER = CS.incident_number
            AND XS.ACTIVITY_TYPE = 'TROUBLESHOOTING')
      AND jtot_object1_code = 'OKX_CUSTPROD'
      AND object1_id2 = '#'
      AND chr_id IS NOT NULL)Edited by: SeánMacGC on Jul 20, 2009 3:37 AM
    And here is a slight different version of the update that should perform a little better:
    update xx_cc_audit xca set contract_number = (
      SELECT contract_number
        FROM okc_k_headers_b okhb
    WHERE id IN (
        SELECT dnz_chr_id
          FROM okc_k_items
        WHERE object1_id1 IN (
          Select XS.instance_id
          FROM cs_incidents_all_b CS,xx_cc_audit XS
          where XS.contract_number is null
            AND XS.SR_NUMBER = CS.incident_number
            AND XS.ACTIVITY_TYPE = 'TROUBLESHOOTING')
      AND jtot_object1_code = 'OKX_CUSTPROD'
      AND object1_id2 = '#'
      AND chr_id IS NOT NULL)
      AND xca.instance_id = okhb.object1_id1
    where contract_number is null;

  • I  Need SQL query

    Hi experts,
      One of our Client asking in Aging Reports along with Customer state and  Country and  District. Please Help me out this issue .. I need this Query.
    Thanks
    Dineshkumar kannan

    Hello Dineshkumar
    Try this one:
    SELECT T1.CardCode, T1.CardName, T1.CreditLine, T0.RefDate, T0.Ref1 'Document Number', T1.ValidFor, T2.Country, T2.County,
         CASE  WHEN T0.TransType=13 THEN 'Invoice'
              WHEN T0.TransType=14 THEN 'Credit Note'
              WHEN T0.TransType=30 THEN 'Journal'
              WHEN T0.TransType=24 THEN 'Receipt'
              END AS 'Document Type',
         T0.DueDate, (T0.Debit- T0.Credit) 'Balance'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')<=-1),0) 'Future'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=0 and DateDiff(day, T0.DueDate,'[%1]')<=30),0) 'Current'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>30 and DateDiff(day, T0.DueDate,'[%1]')<=60),0) '31-60 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>60 and DateDiff(day, T0.DueDate,'[%1]')<=90),0) '61-90 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>90 and DateDiff(day, T0.DueDate,'[%1]')<=120),0) '91-120 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=121),0) '121+ Days'
    FROM JDT1 T0 INNER JOIN OCRD T1 ON T0.ShortName = T1.CardCode INNER JOIN CRD1 T2 ON T1.CardCode = T2.CardCode
    WHERE (T0.MthDate IS NULL OR T0.MthDate > [%1]) AND T0.RefDate <= [%1] AND T1.CardType = 'C'
    ORDER BY T1.CardCode, T0.DueDate, T0.Ref1
    SELECT T1.CardCode, T1.CardName, T1.CreditLine, T0.RefDate, T0.Ref1 'Document Number', T1.ValidFor, T2.Country, T2.County,
         CASE  WHEN T0.TransType=13 THEN 'Invoice'
              WHEN T0.TransType=14 THEN 'Credit Note'
              WHEN T0.TransType=30 THEN 'Journal'
              WHEN T0.TransType=24 THEN 'Receipt'
              END AS 'Document Type',
         T0.DueDate, (T0.Debit- T0.Credit) 'Balance'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')<=-1),0) 'Future'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=0 and DateDiff(day, T0.DueDate,'[%1]')<=30),0) 'Current'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>30 and DateDiff(day, T0.DueDate,'[%1]')<=60),0) '31-60 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>60 and DateDiff(day, T0.DueDate,'[%1]')<=90),0) '61-90 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>90 and DateDiff(day, T0.DueDate,'[%1]')<=120),0) '91-120 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=121),0) '121+ Days'
    FROM JDT1 T0 INNER JOIN OCRD T1 ON T0.ShortName = T1.CardCode INNER JOIN CRD1 T2 ON T1.CardCode = T2.CardCode
    WHERE (T0.MthDate IS NULL OR T0.MthDate > [%1]) AND T0.RefDate <= [%1] AND T1.CardType = 'C'
    ORDER BY T1.CardCode, T0.DueDate, T0.Ref1
    Regards

Maybe you are looking for

  • How do I find out what the video card on my MacBook Pro is?

    I am not sure where to look for this information and am trying to sell my computer. Any help would be appreciated.

  • Apple replacement unlocking question

    I recently got given a replacement phone from Apple for one that had a smashed screen and decided that I would give this to my partner as a gift.  However, she is on a different network than me and even though I thought all Apple iPhone's were unlock

  • Strange JScrollPane problem in JApplet

    I've got a JApplet which is giving me a strange problem with the scrollbar of a JScrollPane. The JScrollPane is populated with a JList whose ListModel is a DefaultListModel. I specify to always show the vertical and never show the horizonatal scroll

  • CS2 will not install

    I had problems with my Dual 1.8 GHz PowerPC G5 running 10.3.9, so I had to reinstall the system software.  I tried to reinstall CS2 and after unistalling and deleting every adobe program on the computer, the install fails.  I am able to go through th

  • Traffic/Service configuration for ISG

    Need help in configuration so that the following requirements should be met: A set of target IP Addresses to be excluded in the traffic defined for a service (access to those IPs should be allowed, only that the traffic should not be qualified under