Need a query

i have tablespace which is 124GB in size.
i ran a query i found out that 86gb space is occupied and 37 gb is freespace..
this tablespace is having 19 datafiles which spreads across to diffrent locations in the disk.
i want tto find out for each datafile how much space is used and how much is free?
i ran a query using dba_free_space,dba_data_files using fileid as common but its giving absurd results..may be iam wrong here..
can any give me the exact query please..
Thanks
Its urgent!!!
regards
NK

also kindly let me know wat is wrong in the query:
col file_name format a66
select file_name,
ceil( (nvl(hwm,1)*16384)/1024/1024 ) possible,
ceil( blocks*16384/1024/1024) current,
ceil( blocks*16384/1024/1024) -
from dba_data_files a,
( select file_id, max(block_id+blocks-1) hwm
from dba_extents
group by file_id ) b
where a.file_id = b.file_id(+) and a.tablespace_name
= '&tsname'
wen i give the name of the TS and hit enter it give
me an error:
ceil( (nvl(hwm,1)*16384/1024/1024 ) saving
line 5:
ORA-00923: FROM keyword not found where expectedThe error is the use of the reserved word "current"
SQL> col keyword format a10
SQL> col reserved format a10
SQL> col res_type format a10
SQL> col res_attr format a10
SQL> col res_semi format a10
SQL> col duplicate format a3
SQL> select *
  2  from v$reserved_words
  3  where keyword = 'CURRENT';
KEYWORD        LENGTH RESERVED   RES_TYPE   RES_ATTR   RES_SEMI   DUP
CURRENT             7 N          N          N          Y          NAs this shows, the word "current" is semi reserved and this means that it can't be used as an identifier in some situations such that DML statements

Similar Messages

  • 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.

  • 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

  • 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

  • Need a query to merge output in a single row?

    Hi All,
    I need a query to merge output in a single row.
    Query :
    Select dname from dept.
    Actual output is :
    Dname
    EDP
    ACCOUNT
    GR
    Desired Output is:
    Dname
    EDP ACCOUNT GR
    Please provide me the solution
    Thanks
    Amit

    select max(sys_connect_by_path (t.name,' '))  from  ( select id,
                            name,
                            group_id,
                            row_number() over (partition by group_id order by id) rn
                       from ( select 1 id, 'test'  name, 1 group_id from dual
                              union
                              select 2 id, 'test1' name, 1 group_id from dual
                              union
                              select 3 id, 'test2' name, 1 group_id from dual
                              union
                              select 4 id, 'test3' name, 1 group_id from dual)  ) t
    start with t.rn = 1 and id = 1
    connect by t.rn = prior t.rn + 1
    group by t.group_id

  • Need a query FMS

    Hi Experts,
    I need a query FMS to display all sales order numbers in a udf of sales invoice (a/r invoice). The udf is in the header.
    Current SAP B1 8.81 SP00 PL09, in the comments field of a/r invoice, it only shows all deliveries numbers but sales order numbers are missing especially one invoice is created based on multiple delivery orders.
    Please help.
    Kind Rgds,
    Steve

    I managed to solve this problem using the following query FMS:
    declare @sonum as nvarchar(30)
    declare @docnum as nvarchar(30)
    declare @sonumb as nvarchar(30)
    declare @remarks as nvarchar(30)
    declare @series as nvarchar(30)
    set @series = $[oinv.series]
    set @docnum = $[oinv.docnum]
    select distinct @sonum =  (SUBSTRING(t0.comments, PATINDEX('Based On Sales Orders', t0.Comments) + 22, 150))  FROM oinv t0 inner join nnm1 t1 on t1.series = t0.series and t0.objtype = t1.objectcode
    where t0.DocNum = @docnum and t0.series = @series
    select distinct @sonumb = LEFT(@sonum,CASE WHEN CHARINDEX('. Based on Deliveries',@sonum)>0 THEN LEN(@sonum)-24 ELSE LEN(@sonum) END)
    select @sonumb
    but it is not perfect because when the user adds another word before the words ; "Based On Sales Orders" in the comments field  of oinv, the SO no. in the UDF will not appear.
    How to remove all characters either based on sales orders or based on deliveries in the comment field ?
    Steve

  • Source table has an xml column that I need to query before splitting into 2 tables.

    Hi
    I have a source table with an xml column that I need to query on the nodes and then depending on what data is in the node then to split it into 2 different tables. I don't think I can use conditional split so I am looking at just a straight Execute SQL Task.
    Has anyone got any ideas on any other way of doing this?
    Thanks for the help in advance.
    Dave

    Hi TheDish,
    Your goal arguably can me accomplished using pure T-SQL only encompassing XPath or XQuery.
    E.g. the XQuery would retrieve the nodes as explained in http://sqljudo.wordpress.com/2013/12/02/xpath-for-the-sql-server-dba/
    And then you may want to use the WHERE clause to extract - insert the nodes that go to one or another table.
    I don't see why SSIS is necessary, but you can run the same queries in two Data Sources, or Execute SQL Tasks (that capture a resultset).
    Arthur
    MyBlog
    Twitter

  • Need ABAP Query Builder Like Ms-SQLQuery Builder for Critical ABAP-Query

    Dear ABAP Friends,
    I Need ABAP Query Builder which is as flexible as Ms-SQLQuery Builder for building Critical ABAP-Queries e.g. "I have 4 master tables , Each master table having self-join with some condition and these 4 Result-Sets have Innser-Join+Left Outer Join " Please Help.

    I have seen TCODE SQ01, But I found that this TCODE may be used to build simple ABAP Query with Selection-screen which can be used for generating simple report. But i think for critical query ??????????
    I have build my Query in MS-SQL and got the right output, Now how do I write this in ABAP Using Join statement. Please Help.....................
    My SQL Query as below(Remember this is a single Query and verified correct in SQL):
    SELECT     P1.PERNR, P1.ENAME, P1.BEGDA AS P1BEGDA, P1.ENDDA AS P1ENDDA, P1.AEDTM AS P1AEDTM, P1.UNAME AS P1UNAME, P1.PERSG, P1.PERSK,
                          P1.PLANS,
           P2.ENDDA AS P2ENDDA, P2.BEGDA AS P2BEGDA, P2.AEDTM AS P2AEDTM, P2.UNAME AS P2UNAME, P2.GESCH, P2.FAMST,
                       P21.ENDDA AS P21ENDDA, P21.BEGDA AS P21BEDDA, P21.AEDTM AS P21AEDTM, P21.UNAME AS P21UNAME, P21.FAMSA, P21.FAVOR, P21.FANAM,
                          P21.FGBDT, P21.FASEX,
                       P0.ENDDA AS P0ENDDA, P0.BEGDA AS P0BEDDA, P0.AEDTM AS P0AEDTM, P0.UNAME AS P0UNAME, P0.MASSN,
                          P0.MASSG
    FROM         (SELECT     TOP (100) PERCENT PA0001_2.PERNR, PA0001_2.ENDDA, PA0001_2.BEGDA, PA0001_2.AEDTM, PA0001_2.UNAME, PA0001_2.PERSG,
                                                  PA0001_2.PERSK, PA0001_2.PLANS, PA0001_2.ENAME
                           FROM          PA0001 AS PA0001_2 INNER JOIN
                                                      (SELECT     PERNR, MAX(ENDDA) AS ENDDA
                                                        FROM          PA0001 AS PA0001_1
                                                        GROUP BY PERNR) AS Pi1
    ON PA0001_2.PERNR = Pi1.PERNR
    AND PA0001_2.ENDDA = Pi1.ENDDA
                                               ORDER BY PA0001_2.PERNR) AS P1 LEFT OUTER JOIN
                              (SELECT     TOP (100) PERCENT PA0000.PERNR, PA0000.ENDDA, PA0000.BEGDA, PA0000.AEDTM, PA0000.UNAME, PA0000.MASSN,
                                                       PA0000.MASSG
                                FROM          PA0000 INNER JOIN
                                                           (SELECT     PERNR, MAX(AEDTM) AS Pi0AEDTM
                                                             FROM          PA0000 AS PA0000_1
                                                             GROUP BY PERNR) AS Pi0 ON PA0000.PERNR = Pi0.PERNR AND PA0000.AEDTM = Pi0.Pi0AEDTM
                                ORDER BY PA0000.PERNR) AS P0 ON P1.PERNR = P0.PERNR LEFT OUTER JOIN
                              (SELECT     TOP (100) PERCENT PA0021.PERNR, PA0021.ENDDA, PA0021.BEGDA, PA0021.AEDTM, PA0021.UNAME, PA0021.FAMSA, PA0021.FAVOR,
                                                       PA0021.FANAM, PA0021.FGBDT, PA0021.FASEX
                                FROM          PA0021 INNER JOIN
                                                           (SELECT     PERNR, MAX(AEDTM) AS Pi21AEDTM
                                                             FROM          PA0021 AS PA0021_1
                                                             GROUP BY PERNR) AS Pi21 ON PA0021.PERNR = Pi21.PERNR AND PA0021.AEDTM = Pi21.Pi21AEDTM
                                ORDER BY PA0021.PERNR) AS P21 ON P1.PERNR = P21.PERNR LEFT OUTER JOIN
                              (SELECT     TOP (100) PERCENT PA0002.PERNR, PA0002.ENDDA, PA0002.BEGDA, PA0002.AEDTM, PA0002.UNAME, PA0002.GESCH,
                                                       PA0002.FAMST
                                FROM          PA0002 INNER JOIN
                                                           (SELECT     PERNR, MAX(ENDDA) AS Pi2ENDDA
                                                             FROM          PA0002 AS PA0002_1
                                                             GROUP BY PERNR) AS Pi2 ON PA0002.PERNR = Pi2.PERNR AND PA0002.ENDDA = Pi2.Pi2ENDDA
                                ORDER BY PA0002.PERNR) AS P2 ON P1.PERNR = P2.PERNR
    xxxxx----
    Edited by: Goutam Roy on May 5, 2009 1:11 PM

  • Need a Query for getting ItemCost from PO Vendor wise

    Hi,Experts We are not maintain different price list for  some particular items , We raised the PO for Multiple vendors with differnt price for the same material. We need a query to find the Item cost with Various Vendor .
    I need the query in the following format
    Po Number, Vendor Name,Item Name, Item Description,Qty, Price,Tax.
    Thanks
    Kamal

    Hi,
    Check this query which looks for the Item doctype Purchase Order and brings the data accordingly :
    select t0.docnum as 'PO Number', t0.CardName as 'Vendor name', t1.itemcode as 'Item Name',
    t1.Dscription as 'Item Description', t1.quantity as 'QTY', t1.Price as 'Price',
    t1.vatsum as 'Tax Amount'
    from OPOR t0 inner join POR1 t1 on t0.docentry = t1.docentry
    where t0.doctype ='I'
    Group by t1.itemcode, t1.Dscription, t0.docnum,
    t0.cardname, t1.quantity, t1.Price, t1.vatsum
    Order by t1.Itemcode
    Check if it helps.
    Kind Regards,
    Jitin
    SAP Business One Forum Team

Maybe you are looking for