How to get dates based on the difference of startdate and enddate

Hi all

I have table with data below:

I need a new line for each record with enddate-startdate > 41 days.

For example if Item1, point 2 difference of enddate-startdateis < 41 if these lines are is

AgendaItem_DescrSTARTDATEENDDATE
1Point 1OCTOBER 16, 2014JANUARY 4, 2015
2Point 2OCTOBER 16, 2014JANUARY 4, 2015

Item3 and Item4 difference is 41 days > and < 82 days so I need two lines as below for each element:

AgendaItem_DescrSTARTDATEENDDATE
3Point 3OCTOBER 16, 201416 OCT-2014 + 41
3Point 316 OCT-2014 + 41 + 1JANUARY 4, 2015
4Point 4OCTOBER 16, 201416 OCT-2014 + 41
4Point 416 OCT-2014 + 41 + 1JANUARY 4, 2015

For Item5 difference is > 41, 82, 123, and < 164 so I need total four lines as below:

AgendaItem_DescrSTARTDATEENDDATE
5Point 5OCTOBER 16, 201416 OCT-2014 + 41
5Point 516 OCT-2014 + 41 + 116 OCT-2014 + 41 41
5Point 516 OCT-2014 + 41 + 41 + 116 OCT-2014-41-41-41
5Point 516 OCT-2014 + 41 + 41 + 41 + 1MARCH 21, 2014

Am able to get the number of rows, but struggling to get the dates as shown:

Am trying to query is:

  SELECT NV.*,
           ENDDATE - STARTDATE,
           LEVEL,
           FLOOR ( (ENDDATE - STARTDATE) / 41)           
      FROM NSK_VALUES NV
CONNECT BY     LEVEL <= FLOOR ( (ENDDATE - STARTDATE) / 41) + 1
           AND ROWID = PRIOR ROWID
           AND PRIOR SYS_GUID () IS NOT NULL;

something like that...

WITH nsk_values (item, item_descr, startdate, enddate)

AS (SELECT 1, ' 1 ', SYSDATE, SYSDATE + double UNION ALL 7 ')

SELECT 2, 'point 2', SYSDATE, SYSDATE + 14 IN double UNION ALL

SELECT 3, 'Item 3, SYSDATE, SYSDATE + 80 IN dual UNION ALL"

Select OPTION 4, "article 4, SYSDATE, SYSDATE + 56 OF double UNION ALL"

SELECT 5, 'article 5 "(, SYSDATE, SYSDATE + 156 FROM dual)

SELECT the item

item_descr

largest (startdate, CASE

WHEN LEVEL > 1 THEN startdate + (LEVEL - 1) * 41 + 1

Of ANOTHER startdate

END

) As startdate

, less (enddate, startdate + (LEVEL * 41)) AS enddate

OF nsk_values

CONNECT BY PRIOR point = item

AND PRIOR sys_guid() IS NOT NULL

and level<= ceil((enddate="" -="" startdate)="">

/

HTH

Tags: Database

Similar Questions

  • How to get a program to the shared program files and data on a different computer?

    I run an accounting program on a Windows XP computer that has all the programs files and data shared to our local network. This accounting program is also installed on several other machines, Windows 7, and I want to know, how I move these Windows 7 machines to use the program and data off the XP machine, instead of using local data files (static)?

    This has been fixed, thanks. I ended the program on the host computer, and on this computer I just run the .exe; i.e. I actually run the program on the host computer.

  • Create lines based on the difference in date

    Hello

    I would like to create lines based on the difference between the start and end dates (per year).

    for example

    ID1  Start_time                                             End_time                                                      ID2
    07/01/2003 1, 12.00.00.000000000 2005-01-07 12.00.00.000000000 123

    07/01/1999 1, 12.00.00.000000000 07/01/2003 12.00.00.000000000 345

    I need:

    ID1  Start_time                                             End_time                                                      ID2
    07/01/2004 1, 12.00.00.000000000 2005-01-07 12.00.00.000000000 123

    07/01/2003 1 12.00.00.000000000 07/01/2004 12.00.00.000000000 123

    1 01/07/2002 12.00.00.000000000 07/01/2003 12.00.00.000000000 345

    07/01/2001 1, 12.00.00.000000000 01/07/2002 12.00.00.000000000 345

    07/01/2000 1, 12.00.00.000000000 01/07/2001 12.00.00.000000000 345

    07/01/1999 1, 12.00.00.000000000 07/01/2000 12.00.00.000000000 345

    Thank you

    Hello

    Here's one way:

    SELECT ID1

    , ADD_MONTHS (start_time, 12 * (LEVEL - 1)) AS start_time value

    , ADD_MONTHS (start_time, 12 * LEVEL) AS end_time

    id2

    FROM table_x

    CONNECT BY LEVEL<= months_between="" (end_time,="" start_time)="">

    AND PRIOR id2 = id2

    AND PRIOR SYS_GUID () IS NOT NULL

    ;

    I'm assuming that id2 is unique.

    Would what results you if end_time wasn't exactly N years after start_time?

  • How to get the difference of current and previous line for a column of the same table?

    Hello

    I have a table where there are 3 rows and say 2 columns only, as below

    Col1               | Col2
    --------------------- |----------------------------------------

    first_flag |  100

    second_flag |  104

    third_flag |  110

    Now, using sql, which accepts a parameter col1, how do I get the bottom o/p

    say that the entry is second_flag,

    output must be

    second_flag, 104, 4 (4 being the difference between 104 and 100)

    If I give the entry like third_flag, the output should be

    third_flag, 110, 6 (6 is the difference between 110 and 104)

    Any help?

    Hello

    Another way is to use the analytic LAG function:

    WITH got_diff AS

    (

    SELECT col1, col2

    , col2 - LAG (col2) over (ORDER BY col1) AS diff

    OF mydata

    )

    SELECT *.

    OF got_diff

    WHERE col1 =: flag_wanted

    ;

    This assumes that the lines are in alphabetical order by col1.  If the order is something else, then use it in the ORDER BY clause analytical.

  • exclude data based on the position

    Hi all

    I use oracle 10g.

    We have a requirement where I need to exclude the data based on the 1st character of a column value.

    A table has a column that contains the varchar value.
    The condition is to exclude all rows where the column begins with an alphabet.

    Example;
     customer table:
    cust_id    cust_name   cust_age
    A123          JOHN            28
    1234         NASH            43
    B345         DEAN            32
    4325         SHAUN          21
    Now I want to select only rows with cust_id = 1234 and 4325 as these 2 is not first character as alphabet.
    There are thousands of row in the table.

    One way is to write all the alphabets as:
      SELECT *
        FROM CUSTOMERS
       WHERE SUBSTR(CUST_ID,1,1) NOT IN ('A','B','C','D',..............'Z');
    But I'm sure there is a better way to do maybe a function that can list all the alphabet or something.

    Kindly tell me how to get this result.

    Kind regards
    Shane
    SELECT *
    FROM CUSTOMERS
    WHERE NOT regexp_like(cust_id, '^[A-Z]');
    

    Published by: thomas.kellerer on August 11, 2009 02:08

  • How to get data from an Excel file exist using report generation tools

    I try to use the Excel vi get the data of the report generation tool, but I can't understand how to activate a path can be explored in the right type for the VI.  I tried to use the new Report.vi, but this does not work unless you use a template.  It will not open an existing excel file and make an open report to extract data from.

    Essentially, I have a bunch of excel files that have data in them, and I want a VI allows to analyze the data.  I'm going to pull in all the data directly from the excel file so I don't have to reproscess them all in text so I can use the more standard datasheet live but to convert even the excel file programtically in labview I still need to be able to open the excel file and get the data?

    I found my problem.  It turns out that only not to have had a problem with the tool box new report vi.  I had accidentally wired an input control of path of folder instead of an input control of path of file to it.  Changing the file type took care of her and I was able to access excel files, I tried using the new report VI to extract the file, and Excel Get Data to extract the data.

  • How to get other channels in the channel list.

    Hi experts,

    How to get other channels in the channel list.

    for example

    "Country1, Italy countries2, India, countries3, paris, countries4, scottland, Canada5, rome"

    in the list above, I need to get all the countries and their names separately.

    as countries1, countries2, countries3 countries4 Canada5

    India, paris, Scotland, Italy, rome

    I try the one above in the fashion below

    SELECT SUBSTR

    ("Country1, Italy, countries2, India, countries3, paris, countries4, scottland, Canada5, rome,

    1,

    INSTR

    ("Country1, Italy, countries2, India, countries3, paris, countries4, scottland, Canada5, rome,

    ',',

    1,

    1

    )

    -1

    )

    OF THE DOUBLE

    everything please help me

    If you want the data to be more structured and useful:

    Column collar for a20
    Col col_value to a20

    inlist var VARCHAR2 (2000)

    exec: inlist: = 'Country1, Italy, countries2, India, countries3, paris, countries4, scottland, Canada5, rome;
    exec: inlist: = replace (: inlist,' ')

    Select max (decode (mod(lvl,2), 1, value)) Column
    , max (decode (mod(lvl,2), 0, value)) col_value
    from (select substr (: InList, + 1 start_pos, end_pos-start_pos-1) value)
    lvl
    from (select: InList)
    case when level = 1 then
    0
    on the other
    InStr(:InList,',',1,Level-1)
    end start_pos
    case when instr(:InList,',',1,level) = 0
    then length(:InList) + 1
    on the other
    InStr(:InList,',',1,Level)
    end end_pos
    level lvl
    of the double
    connect by level<>
    )
    )
    ceil(lvl/2) group
    order by 1;
          
    COLUMN COL_VALUE
    ____________________ ____________________
    Country1 Italy
    countries2 India
    countries3 paris
    Scottland countries4
    country5 rome

    Not tested on 10g

    Then you could stragg lines together...

  • How to get a list of the tables more fragmented in Oracle?

    Is there a SQL on how to get a list of the tables more fragmented in the Oracle DBMS?

    Update the statistics on the table and try this, you should see very fragmented tables upstairs with high wasted_space.

    select table_name,round((blocks*8),2) "size (kb)" ,
                                round((num_rows*avg_row_len/1024),2) "actual_data (kb)",
                                (round((blocks*8),2) - round((num_rows*avg_row_len/1024),2)) "wasted_space (kb)"
    from dba_tables
    where (round((blocks*8),2) > round((num_rows*avg_row_len/1024),2))
    order by 4 desc
    

    I changed the query a little because the ORDER BY will not work if we concat | ' Ko ' with the column because this makes the output a character column data.
    And added a WHERE condition to see that these tables where the total size is greater than the actual size of data.

    Published by: zahid79 on July 23, 2010 13:40

  • Problem when sorting the data based on the date

    I am trying to sort the following data based on the column of date of receipt of Transaction, couldn't do it usi g the following syntax:

    <? sort: TRANSACTION_RECEIPT_DATE; ' ascending '; type_donnees = 'date '? >

    I have problem to convert the canonical date report date, there at - it another way to reach the exit without converting the date format.

    <? XML version = "1.0"? >
    <! - generated by the Oracle version 6.0.8.27.0 reports - >
    < RECDTREP >
    < LIST_G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    < VENDOR_LOT_NUM > PO104 < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 7 April 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > < / SNO_ATTRIBUTE1 >
    < > 24636 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 7 April 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510863063 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 7 April 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 982121 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    < VENDOR_LOT_NUM > PO107 < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 7 April 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > < / SNO_ATTRIBUTE1 >
    < > 24641 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 7 April 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510863068 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 7 April 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 982121 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    PO123 < VENDOR_LOT_NUM > < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 7 April 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > 2008/06/11 00:00:00 < / SNO_ATTRIBUTE1 >
    < > 24658 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 7 April 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510863086 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 7 April 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 982121 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    PO75 < VENDOR_LOT_NUM > < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 31 March 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > < / SNO_ATTRIBUTE1 >
    < > 22190 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 14 April 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510860842 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 31 March 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 971515 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    < VENDOR_LOT_NUM > PO116 < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 25 June 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > 2008/06/11 00:00:00 < / SNO_ATTRIBUTE1 >
    < > 64271 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 30 June 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510863077 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 25 June 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 982121 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    < VENDOR_LOT_NUM > PO92 < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 31 March 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > 2008/06/11 00:00:00 < / SNO_ATTRIBUTE1 >
    < > 22253 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 14 April 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510860890 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 31 March 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 971515 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    < VENDOR_LOT_NUM > PO99 < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 31 March 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > < / SNO_ATTRIBUTE1 >
    < > 22263 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 14 April 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510860899 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 31 March 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 971515 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    < VENDOR_LOT_NUM > PO109 < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 25 June 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > < / SNO_ATTRIBUTE1 >
    < > 64204 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 30 June 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510863070 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 25 June 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 982121 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    < VENDOR_LOT_NUM > PO135 < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 25 June 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > 18/06/2008 00:00:00 < / SNO_ATTRIBUTE1 >
    < > 64296 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 30 June 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510875546 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 25 June 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 982121 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    < VENDOR_LOT_NUM > PO101 < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 7 April 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > < / SNO_ATTRIBUTE1 >
    < > 24618 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 7 April 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510863046 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 7 April 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 982121 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    < VENDOR_LOT_NUM > PO120 < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 7 April 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > 2008/06/11 00:00:00 < / SNO_ATTRIBUTE1 >
    < > 24653 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 7 April 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510863081 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 7 April 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 982121 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    < VENDOR_LOT_NUM > PO122 < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 7 April 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > 2008/06/11 00:00:00 < / SNO_ATTRIBUTE1 >
    < > 24657 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 7 April 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510863085 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 7 April 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 982121 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    < VENDOR_LOT_NUM > PO127 < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 7 April 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > 2008/06/11 00:00:00 < / SNO_ATTRIBUTE1 >
    < > 24662 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 7 April 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510863090 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 7 April 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 982121 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    PO100 < VENDOR_LOT_NUM > < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 7 April 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > < / SNO_ATTRIBUTE1 >
    < > 24585 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 7 April 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510863033 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 7 April 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 982121 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    < VENDOR_LOT_NUM > PO110 < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 25 June 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > 2008/06/11 00:00:00 < / SNO_ATTRIBUTE1 >
    < > 64265 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 30 June 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510863071 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 25 June 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 982121 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < G_ASW_REC_DATE >
    < SNO_CREATED_BY > 1433 < / SNO_CREATED_BY >
    < SNO_REQUEST_ID >-1 < / SNO_REQUEST_ID >
    < VENDOR_LOT_NUM > PO130 < / VENDOR_LOT_NUM >
    < SNO_CREATION_DATE > 25 June 09 < / SNO_CREATION_DATE >
    < SNO_ATTRIBUTE1 > 2008-06-13 00:00:00 < / SNO_ATTRIBUTE1 >
    < > 64275 OBJECT_ID < / OBJECT_ID >
    < INITIALIZATION_DATE > 30 June 09 < / INITIALIZATION_DATE >
    < ORGANIZATION_CODE > 10 < / ORGANIZATION_CODE >
    < ORGANISATION_NAME > NDC - PARTS < / ORGANISATION_NAME >
    < Serial_number > 6510875487 < / Serial_number >
    < ITEM_CODE > 3000.006 < / ITEM_CODE >
    < DESCRIPTION > ALLISON 3000 SERIES WE HWY TRANSMISSION E016392 < / DESCRIPTION >
    ALLISON < MANUFACTURER > < / MANUFACTURER >
    < APPLICATION > home < / APPLICATION >
    < ITEM_COST > 8879.02 < / ITEM_COST >
    < MATERIAL_COST > 631.09 < / MATERIAL_COST >
    AUD < CURRENCY_CODE > < / CURRENCY_CODE >
    < PO_UNIT_PRICE > < / PO_UNIT_PRICE >
    < TRANSACTION_RECEIPT_DATE > 25 June 09 < / TRANSACTION_RECEIPT_DATE >
    < PO_NUMBER > 982121 < / PO_NUMBER >
    < / G_ASW_REC_DATE >
    < / LIST_G_ASW_REC_DATE >
    < CF_SORT_BY > manufacturing, the Date of receipt, organization, Code section < / CF_SORT_BY >
    < CF_SERIAL_WHERE > < / CF_SERIAL_WHERE >
    < / RECDTREP >

    HELLO Manu,

    7 April 09
    It is not a date,
    If you need to change the query to get the format to the xsd format: YYYY-MM-ddTHH + hh: mm

    otherwise, you need to write a custom sort function to decode and order it.
    If you make custom order and use

    the data will be processed as a string and you will see that the line is sorted on the channel.

  • Select data based on the priority of the State

    ID PRO_ID PRO_OBJ_ID TASK_ID DEVELOPER_ID STATUS
    121243 4940 37506 5250 6532 REJECTED
    122063 4940 37506 5250 6532 RELATIVES
    138306 4940 37506 5250 6532 ACCEPTED
    138307 4940 37506 5250 6532 WIP




    Hello

    In the table above, I need to select data based on the State, a status which precedes CLOSE or ACCEPTED it should display all status any State which is after CLOSE or ACCEPTED, we do not consider.


    In the scenioro above, it should display only the status of first three. After having ACCEPTED, it should not display something


    Please suggest me a request how to write.


    Thank you
    Sudhir.

    Try:

    SQL> with t as (
      2  select 121243 id, 4940 pro_id, 37506 pro_obj_id, 5250 task_id, 6532 developer_id, 'REJECTED' status from dual union all
      3  select 122063, 4940, 37506, 5250, 6532, 'CLOSE' from dual union all
      4  select 138306, 4940, 37506, 5250, 6532, 'ACCEPTED' from dual union all
      5  select 138307, 4940, 37506, 5250, 6532, 'WIP' from dual union all
      6  select 138308, 4940, 37506, 5250, 6532, 'ACCEPTED' from dual union all
      7  select 138309, 4940, 37506, 5250, 6532, 'REJECTED' from dual union all
      8  select 121243, 4940, 37777, 5250, 6532, 'REJECTED' from dual union all
      9  select 122063, 4940, 37777, 5250, 6532, 'CLOSE' from dual union all
     10  select 138306, 4940, 37777, 5250, 6532, 'ACCEPTED' from dual union all
     11  select 138307, 4940, 37777, 5250, 6532, 'WIP' from dual union all
     12  select 138308, 4940, 37777, 5250, 6532, 'ACCEPTED' from dual union all
     13  select 138309, 4940, 37777, 5250, 6532, 'WIP' from dual
     14  ) -- actual query starts here:
     15  select t1.id
     16  ,      t1.pro_id
     17  ,      t1.pro_obj_id
     18  ,      t1.task_id
     19  ,      t1.developer_id
     20  ,      t1.status
     21  from   t t1
     22  where id <= (select max(id)
     23               from   t t2
     24               where  t2.status in ( 'ACCEPTED', 'CLOSED' )
     25               and    t1.pro_id = t2.pro_id
     26               and    t1.pro_obj_id = t2.pro_obj_id
     27               and    t1.task_id = t2.task_id
     28               and    t1.developer_id = developer_id
     29               );
    
            ID     PRO_ID PRO_OBJ_ID    TASK_ID DEVELOPER_ID STATUS
    ---------- ---------- ---------- ---------- ------------ --------
        121243       4940      37506       5250         6532 REJECTED
        122063       4940      37506       5250         6532 CLOSE
        138306       4940      37506       5250         6532 ACCEPTED
        138307       4940      37506       5250         6532 WIP
        138308       4940      37506       5250         6532 ACCEPTED
        121243       4940      37777       5250         6532 REJECTED
        122063       4940      37777       5250         6532 CLOSE
        138306       4940      37777       5250         6532 ACCEPTED
        138307       4940      37777       5250         6532 WIP
        138308       4940      37777       5250         6532 ACCEPTED
    
    10 rows selected.
    

    If it works then please provide us with some representative sample data again.

  • How to display date / time in the browser console?

    How to display date / time in the browser console?

    You can set through the Options (gear icon) page in the Web Console (Firefox/tools > Web Developer).
    This applies to the browser console and the Web console.

  • How to get Firefox to ignore the status of liaison visits when printing?

    How to get Firefox to ignore the status of liaison visits when printing?

    When I print something, visited links are a different color than unvisited links.
    Is there a way to make the color even when printing?
    (without changing the story, or how things look on the screen)

    If there isn't a way to do that, how about this by adding as a feature?

    One way to do would be to create style rules customized for the printed output that hardcode the link colors for all of the printed output. Firefox supports two ways to proceed: a file userContent.css that you create in the folder settings, and a custom stylesheet applied using the Stylish extension.

    However, 'one size fits all' could lead to unreadable results or ugly on some pages. If an add-on that can do adaptive way would be better. I do not know if someone has created a.

    For sites that do not require a login and that are not personalized, you could launch the page in a private window (right click on the link > open in a new private window or copy the URL and then Ctrl + Shift + p, then paste it in the address bar and enter). Because private windows have their own history, the print should not reflect the history of your regular windows.

  • How to get Firefox to check the compatibility of the addon first, then ask me if I want to continue the update of Firefox?

    How to get Firefox to check the compatibility of the add-on first, then ask me if I want to continue the update of Firefox? The update process currently only told me that an add-on has been disable after you apply the update to Firefox. Options > Advanced Options > switch to the update tab, "Warn me if this turns off one of my modules," doesn't seem to work.

    delores51

    This is an add-on that does this.

    https://addons.Mozilla.org/en-us/Firefox/addon/is-it-compatible/

    More specifically, what modules are always appear as incompatible after a Firefox updated? Firefox 10, extensions that are made properly shouldn't be a problem, with a few exceptions.

    Extension that contains a binary code must be compiled for each new version of Firefox. These modules are usually installed by applications on security Norton, McAfee, ZoneAlarm, etc..

  • Is the difference between TSMC and Samsung Chip in the real Iphone 6 s? If this is the case, how can I found it before buying a new? How can I

    Is the difference between TSMC and samsung chip processors in the real Iphone 6 s? If this is the case, how can I found it before buying a new one?

    No, it isn't.

  • How to get a program all the list of the names of the values in a registry key?

    Hello

    How to get a program all the list of the names of the values in a key of windows registry without having to configure the number of values in the key?

    Thank you & best regards

    Samuel J

    Hi Samuel,.

    you will get this info from "Query registry key Info.vi".

    Mike

Maybe you are looking for

  • Recovery Disc Creator Error - Satellite L300D

    Hello First of all, sorry for my English, but it is not my mother tongue. About my technical problem is very simple: I use Toshiba Satellite L300D-13 b with Vista 32 bit. I tried to create a recovery using Toshiba Recovery Disc Creator disc, but when

  • Redirection Adware problem

    I am new user of MacBook (less than 24 hours) and already makes it painful to use because someone told me there is no virus for Mac, I was carelessly downloading of programs and I am here... My browsers (Chrome and Safari) are double tabs, we repeat

  • Printer Setup

    Is there a way to choose which "setup" to use for printing, for example project / BW etc...

  • Secuity Tool.Ink - worm?

    worm Lsas.Blaster.Keyloger remote host. rundle32.exeC program 62432825\62432825.exeSecuity Tool.InkI don't know how to get through this!This app fills my screen and won't let me go anywhere... he wants my $ and watch multiple infections.   I don't kn

  • How to lock the two images on BOTH edges of the browser?

    HelloI'm building a sensitive site and need to lock the images on BOTH edges of the browser window. I looked for relevant discussions and found a way to block the image to the left of the window by changing the settings of the site properties by sett