Filter by date range table

I use JDev 11.1.1.6

I'm following Frank worm detailed information on how to filter the ADF tables by date range. The link is below.


http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/59-table-filter-by-data-range-176653.PDF


I have 2 problems that I deal. They are:

(1.) the datapicker for both filters are not make the date picker when I click on it. As I said I use 11.1.1.6 which I think should work. Note to Frank says he did not before 11.1.1.6. I can manually enter the date ranges and the filter works.
2.) when I filter by my date or any other filter on the page, the filter returns the data that I expect to be back. For some reason the date filter is more restores. It's as if the entire filter facet disappears. I suspect it is because I do something wrong in the bean support. I posted this code below.

Let me know if you have thoughts about what I might get hurt.


{} public void onQuery (QueryEvent pQueryEvent)
ArrayList < object > lAuditCodeArray = null;
FilterableQueryDescriptor = lFilterableQueryDescriptor
(FilterableQueryDescriptor) pQueryEvent.getDescriptor ();
as submitted by the user such current filter criteria
Map lCriteriaMap = lFilterableQueryDescriptor.getFilterCriteria ();

The method links to set on the access ViewCriteria bind variables.
OperationBinding = lRangeStartOperationBinding
getBindings () .getOperationBinding ("setAuditDateRangeStart");
OperationBinding = lRangeEndOperationBinding
getBindings () .getOperationBinding ("setAuditDateRangeEnd");
Object lAuditDateStartRange = lCriteriaMap.get ("AuditDateStartRange");
Object lAuditDateEndRange = lCriteriaMap.get ("AuditDateEndRange");
lRangeStartOperationBinding.getParamsMap () .put ("value",
lAuditDateStartRange);
lRangeEndOperationBinding.getParamsMap () .put ("value",
lAuditDateEndRange);
lCriteriaMap.remove ("AuditDateStartRange");
lCriteriaMap.remove ("AuditDateEndRange");
lRangeStartOperationBinding.execute ();
lRangeEndOperationBinding.execute ();


lFilterableQueryDescriptor.setFilterCriteria (lCriteriaMap);

run the default QueryListener code added by JDeveloper
ADFUtil.invokeMethodExpression ("#{bindings.") Audit2Query.processQuery} «»
Object.Class, QueryEvent.class,
pQueryEvent);


filter of restoration carried out by the user selection
llCriteriaMap.put ("AuditDateStartRange", lAuditDateStartRange);
lCriteriaMap.put ("AuditDateEndRange", lAuditDateEndRange);
lFilterableQueryDescriptor.setFilterCriteria (lCriteriaMap);
}



Here's the column I'm filtering where it's useful.


< af:column sortProperty = "CrtdDttm" sortable = "true".
headerText = "Date".
ID = "crtDate" align = "center" width = "260".
filterable = "true" >
< f: facet = name 'filter' >
< af:panelGroupLayout id = "pgl1" layout = "horizontal" >
< af:panelLabelAndMessage label = "" to: ""
ID = "plam1" >
< af:inputDate id = "id1".
value = "#{vs.filterCriteria.AuditDateStartRange} '"
clientComponent = "false" >
< af:convertDateTime pattern = "#{bindings." CsgAudit2.hints.CrtdDttm.format}"/ >
< f: validator binding = "#{bindings." CrtdDttm.validator} "/ >"
< / af:inputDate >
< / af:panelLabelAndMessage >
< af:spacer width = "5" height = "5".
ID = "s5" / >
< af:panelLabelAndMessage label = "" to: ""
ID = "plam2" >
< af:inputDate id = "id2".
required value = "#{vs.filterCriteria.AuditDateEndRange}" = 'false' "
clientComponent = "false" >
< f: validator binding = "#{bindings." CrtdDttm.validator} "/ >"
< af:convertDateTime pattern = "#{bindings." CsgAudit2.hints.CrtdDttm.format}"/ >
< / af:inputDate >
< / af:panelLabelAndMessage >
< / af:panelGroupLayout >
< / f: facet >
< af:inputDate value = "#{row.bindings.CrtdDttm.inputValue} '"
required = "#{bindings." CsgAudit2.hints.CrtdDttm.mandatory}.
shortDesc = "#{bindings." CsgAudit2.hints.CrtdDttm.tooltip}.
ID = "id3" readOnly = "true" >
< f: validator binding="#{row.bindings.CrtdDttm.validator}"/ >
< af:convertDateTime pattern = "#{bindings." CsgAudit2.hints.CrtdDttm.format}"/ >
< / af:inputDate >
< / af:column >

Can you try to remove the validator and convert date time to the side of the filter and check.
I had a similar problem with my custom filter and the filter facet did not. I discovered that it was because I had created a property my filter component (selectonechoice) bean binding.
I used version Jdev 11.1.1.4.

Thank you
Rakesh

Tags: Java

Similar Questions

  • Recover data to leave the date range Table

    Hi all

    We leave detail table for each employee contains information of beach to leave as follows.
    EmpID, leaveFromDt, leaveToDt

    We must identify no.. sheets for each employee from the date of the day & current date + group 2 weeks per each week.

    If data should look like,

    Name of the EMP of leaves
    Week 1 semaine2
    0 5 emp1
    3 2 EMP2

    How can this be achieved?

    Here are the possible scenarios assuming
    Date of the day = 10 may 2012
    Current date plus 2 weeks is 24 may 2012

    (1) absent from = 20 may 2012
    Missing = may 25, 2012

    (2) absent from = May 16, 2012
    Missing = may 20, 2012

    (3) = 6 may 2012 absent
    Absent to = 30 may 2012

    (4) missing = may 8, 2012
    Absent in = 12 may 2012

    Hello

    The preliminary motion should be changed to the definitions of the new week.

    The main request must add the number of days, rather than counting sheets.
    To include employees who did not leave during these 2 weeks, you should do an outer join:

    WITH     got_weeks     AS
    (
         SELECT     1 AS week_num, TRUNC (SYSDATE) AS from_dt, TRUNC (SYSDATE) + 6 AS to_dt          FROM dual     UNION ALL
         SELECT     2,               TRUNC (SYSDATE) + 7,        TRUNC (SYSDATE) + 13             FROM dual
    )
    SELECT       e.emp_id
    ,      SUM ( CASE
                    WHEN w.week_num = 1
                        THEN 1 + LEAST    (w.to_dt,   e.leave_to_dt)
                        - GREATEST (w.from_dt, e.leave_from_dt)
                 ELSE 0
                END
              )          AS &week_1
    ,      SUM ( CASE
                    WHEN w.week_num = 2
                        THEN 1 + LEAST    (w.to_dt,   e.leave_to_dt)
                        - GREATEST (w.from_dt, e.leave_from_dt)
                 ELSE 0
                END
              )          AS &week_1
    FROM              empleavedtls        e
    LEFT OUTER JOIN       got_weeks        w  ON   w.from_dt     <= e.leave_to_dt
                           AND  w.to_dt     >= e.leave_from_dt
    GROUP BY  e.emp_id
    ORDER BY  e.emp_id
    ;
    

    Instead to make 2 essentially the same CASE expressions, with FEWER and more calculations in each of them, you could do that once, in a subquery, and then, since you have Oracle 11, you can use SELECT... PIVOT function to get the totals in two columns. This would make it easier to add additional weeks. This is another good exercise.

  • Filter on date ranges

    Hello experts,

    I'm stuck with a little problem here... need your help to resolve it.

    My requirement is

    If I run a report on the Tuesday, Wednesday, Thursday and Friday, and then select the day before for the report date
    If I run the Monday report - select fri, Saturday & Sunday for the report date

    Sweta says:
    (CASE
    WHEN TO_CHAR(sysdate,'D') > 2 THEN TRUNC (sysdate - 1).
    Of OTHER BETWEEN TRUNC (sysdate - 3) AND TRUNC (sysdate - 1).
    END)

    Your case statement is assuming that you want to return the literal "BETWEEN TRUNC (sysdate - 3) AND TRUNC (sysdate - 1) ' and it does not work like that. Although you do not give us enough details my initial response can be used to do the following:

    SELECT      ...
    FROM     ...
    WHERE     SOME_DATE_COL >= (CASE
                        WHEN TO_CHAR(sysdate,'D') > 2 THEN TRUNC(sysdate - 1)
                        ELSE TRUNC(sysdate - 3)
                   END)
    AND     SOME_DATE_COL <= TRUNC(sysdate)
    
  • Article 059 (filter how-to ADF related tables by date range) in JDeveloper 12 c (12.1.3)

    Hello.

    I try to implement a solution to article 059 (filter how-to ADF related tables by date range) in JDeveloper (12.1.3) 12 c but hothing happen when I start this example.

    Could someone advise me what to do to make this example work properly on JDeveloper 12 c?

    I made the example work again. The problem is that you can't somehow store new attribute values in the card more. If you store the values for the filter to a different place, it works again.

    Please read the complete solution in my blog https://tompeez.wordpress.com/2015/04/11/how-to-filter-adf-bound-tables-by-date-range-jdeveloper-12-1-x/

    You can download the workspace of GitHub. The link is provided at the end of the blog.

    Timo

  • How to pass the date range as in URL filter go

    Hello

    I am trying to build a Url go that has two filters, date range & text. I built the url below, but he continues to throw an error. The url is not from the date max and the app starts following error:

    Error: Status: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error occurred. [nQSError: 46048] Month DateTime value 0 0000-00-00 is off limits. (HY000)

    Go to Url: https:companyUrl? GB & Options = rfd & Path = / shared/CompanyID/link & P0 = 2 & P1 = eq & P2=CustomObject4.%22Indexed%20Pick%201%22 & P3 = Leasing & bet = P4 & P5 = ""-CustomObject4 Custom Attributes '. " ZDate_26 & P6 = 2 + Date % 20'2014-08-01'+ day % 20'2014-12-31'


    Please suggest.

    Thank you
    Kiran.

    It seems that you convert the data type of char to date in the URL, I don't think that this is possible.
    Your code is like
    & P6 = 2 + Date % 20'2014-08-01'+ day % 20'2014-12-31'

    It suppose to be & P6 = 2 + 2014-08-01 + 2014-12-31

    I suggest doing the formatting for this filed using column properties and try.

    Hope this help, pls mark if yes ;)

  • To add totals in a certain date range

    I have 3 sheets. Income, expenses and then an annual journal (has twelve columns, one for each month). Is there a way to get the numbers to add totals to a column of the spreadsheet of spending within the date range 01/01/16 and 31/01/16 and put the total in a cell in January on my sheet of each year. I can't understand a formula so that it can find the date range. I get a synyax error message.

    Assumptions:

    Your TABLES (not the leaves) are named income, spending and summary. Here is any other tables in the document with these names.

    Dates of expenditure are in column A of the table expenses. Other than the header line, all the entries in this column are values Date and time that have been entered as dates only.

    The amount for each item of expenditure is in column C of the expense table.

    Line 1 of the analytical table is defined as a header line.

    January is in column A of the summary table.

    Summary::A1 cell contains the date January 1, 2016, but can be formatted to display only the name of the month or the month and year. (but see the note below) *.

    Enter the formula in the cell that will contain total expenditures recorded with dates in January 2016 below:

    = SUMIFS ("Expenses: Expenses, $C: $A," > = "& A1, Expenses: $A," < = "& EOMONTH(A1,0))

    Example: All the amounts of expenditure were reduced to 1.00 simple confirmation of funds.

    * NOTE: The formula has previously worked with the format of the cells in the row 1 Summary defined to show only the month and the year (two digits) of the effective date values (the first day of the month indicated), but the table I built tonight January 1, 2015 to the format to display 16 Jan, one was interpreted as January 16 (2016) , and SUMIFS formula did not include not January 1 to January 14 numbers in January total.

    A custom, displaying the month (short or long) and the year (four digits) or a custom format shows only the name of the month (short or long) gave good results.

    Note that any format under control of the display, the effective date is the first of the month displayed.

    Table built and tested in Numbers ' 09 (v 2.3)

    Kind regards

    Barry

  • How to transfer data from the data in table 2D only once file?

    Attached file will write same data in table 4 times 2D file. Output must be in a table 2D.

    Someone will provide a solution or a reason to explain why the data are been ouputted 3 more times? Thank you

    I already told you a better and more effective method. The function of reading worksheet is on the exact same range as your text file and does everything for you. If you insist for some reason strange kernel to reinvent the wheel and write your own code, take the correct path. The use of 4 separate spreadsheet String to Array is the cause of your problem and I already said too much. Don't you think that get you 4 times the data is in correlation with the fact you are using 4 times the functions necessary at all? It is simply not true. Look at the diagram-writing block on a spreadsheet file.

  • AMOUNT of Oracle with the date range

    Hello community,

    I'm having a problem with the addition of a field with a date range. It comes to my table

    JVREFVARCHAR210------
    SOURCEVARCHAR22------
    PERIODVARCHAR26------
    JVDATENUMBER-380-Nullable--
    GLCODEVARCHAR224------
    DESCRVARCHAR240---Nullable--
    AMOUNT_0FLOAT4848--Nullable--
    AMOUNT_1FLOAT4848--Nullable--
    JVTYPEVARCHAR24

    and I'm glad the the following statement works as expected

    SELECT AMOUNT_1 FROM 'TABLE' where

    TO_DATE ("PERIOD, ' YYYYMM") > = to_date ("'201501 ',' YYYYMM")

    and

    TO_DATE (PERIOD, 'YYYYMM') < = to_date ("'201502 ',' YYYYMM");

    E.g.

    AMOUNT_1

    56192.48

    59863.57

    48570.1

    72407.12

    21626.96

    35532.96

    75860.67

    25623.62

    54799.83

    16872.3

    The next thing I want to do is the sum of these amounts... so I changed my statement to become

    SELECT SUM (AMOUNT_1) 'TABLE' where

    TO_DATE ("PERIOD, ' YYYYMM") > = to_date ("'201501 ',' YYYYMM")

    and

    TO_DATE (PERIOD, 'YYYYMM') < = to_date ("'201502 ',' YYYYMM");

    and now I'm getting

    ORA-01841: (full) year must be between-4713 and 9999 and not 0

    I also tried

    SELECT THE PERIOD (AMOUNT_1) SUM OF "BRE". "' OPW_NMLTRX ' where

    TO_DATE ("PERIOD, ' YYYYMM") > = to_date ("'201501 ',' YYYYMM")

    and

    TO_DATE (PERIOD, 'YYYYMM') < = to_date ("'201502 ',' YYYYMM")

    Group by PERIOD

    with the same results... I can't figure out what I should do next?

    Thank you.

    Hello

    Solomon Yakobson says:

    Question:

    SELECT *.

    From your_table

    WHERE the TO_NUMBER (SUBSTR (PERIOD, 1, 4)) NO BETWEEN-4713 and 9999

    OR TO_NUMBER (SUBSTR (PERIOD, 1, 4)) = 0

    /

    To find the offending rows.

    SY.

    This can cause other errors, according to what is in this column.  A better way would be something like:

    Primary_key SELECT, period - add more columns you want

    'TABLE' - avoid names which need quotation marks

    (Period WHERE the TRANSLATION)

    '012345678'

    '999999999'

    ) <> = "999999"

    OR SUBSTR (period, 1, 4), not BETWEEN "1900" AND "2099"

    OR SUBSTR (period 5) NOT BETWEEN '01' to '12'

    ;

    Now there may be errors of conversion, because there is no conversion.

  • To ignore the date ranges that overlap

    Hi guys,.

    I have the tables below

    Periods

    START_DATEEND_DATEID
    30-SEP-0513 OCTOBER 051
    12 OCTOBER 0514 NOVEMBER 052
    15 NOVEMBER 0515 DECEMBER 053

    T1

    DAT_COLIDAMOUNT
    11 OCTOBER 05110
    12 OCTOBER 05110
    16 NOVEMBER 05110

    I need to ignore the remaining date range if it overlaps when comparing dat_col from T1 between the dates of beginning and end of periods table. Always need to consider the first periods

    output something like this

    IDID_1START_DATEEND_DATEDAT_COL
    1130-SEP-0513 OCTOBER 0511 OCTOBER 05
    1130-SEP-0513 OCTOBER 0512 OCTOBER 05
    1315 NOVEMBER 0515 DECEMBER 0516 NOVEMBER 05

    I use query

    Select a.id, b.id, b.start_date, b.end_Date, a.DAT_COL from T1 a, (select id, start_date, end_date periods) b

    where a.dat_col between b.start_Date and b.end_Date

    Group of a.id, b.id, b.start_date, b.end_Date, a.dat_col

    order of b.start_date;

    IDID_1START_DATEEND_DATEDAT_COL
    1130-SEP-0513 OCTOBER 0511 OCTOBER 05
    1130-SEP-0513 OCTOBER 0512 OCTOBER 05
    1212 OCTOBER 0514 NOVEMBER 0512 OCTOBER 05
    1315 NOVEMBER 0515 DECEMBER 0516 NOVEMBER 05

    Test case:

    CREATE TABLE 'PERIODS '.

    ("START_DATE" DATE,

    "END_DATE" DATE,

    'ID '.

    ) ;

    Insert into periods (start_date, end_date, ID) values (to_date('30-SEP-05','DD-MON-RR'),to_date('13-OCT-05','DD-MON-RR'),1);

    Insert into periods (start_date, end_date, ID) values (to_date('12-OCT-05','DD-MON-RR'),to_date('14-NOV-05','DD-MON-RR'),2);

    Insert into periods (start_date, end_date, ID) values (to_date('15-NOV-05','DD-MON-RR'),to_date('15-DEC-05','DD-MON-RR'),3);

    Insert into T1 (DAT_COL, ID) values (to_date('11-OCT-05','DD-MON-RR'), 1);

    Insert into T1 (DAT_COL, ID) values (to_date('12-OCT-05','DD-MON-RR'), 1);

    Insert into T1 (DAT_COL, ID) values (to_date('16-NOV-05','DD-MON-RR'), 1);

    CREATE TABLE 'T1 '.

    (DATE OF THE 'DAT_COL',

    'ID '.

    );

    Hello

    If you really want to use something close to what you posted, then you can do it like this:

    WITH got_r_num AS

    (

    SELECT a.id

    b.id AS id_1

    b.start_date

    b.end_date

    a.dat_col

    , ROW_NUMBER () OVER (PARTITION BY a.id, a.dat_col)

    ORDER BY b.start_date, b.end_date

    ) AS r_num

    FROM one t1

    ,         (

    SELECT id, start_date, end_date

    Periods

    ) b

    WHERE a.dat_col BETWEEN b.start_date

    AND b.end_date

    GROUP BY a.id, b.end_date, a.dat_col, b.start_date and b.id

    )

    SELECT id, id_1, start_date, end_date, dat_col

    OF got_r_num

    WHERE r_num = 1

    ORDER BY start_date

    ;

    Note that the WITH clause, that's essentially what you posted in your first post (with the added r_num column) and the main request is essentially the same as in response #1.

    But why would you do something like that?  View online or GROUP BY allows all.  If you remove them, you get the #1 response solution.

  • Find (weekly) missing date ranges based on the Date of submission

    Nice day:

    I have a table that contains the data with a date of presentation of the report column.  If the requirements are that each employee must submit at least 1 weekly report beginning January 1, 2015, how can I find the weekly reports missing, based on the date of submission of reports.

    The ideas that I had:

    • Left join by partition by date (range between)
    • Create a date dimension view?

    Of course, I'm not sure how to approach this dilemma without creating a query of Monster.  Sometimes the simplest queries mistake me...

    Thank you, Aqua

    Here are the DDL for the table with the information from the presentation report (example):

    --------------------------------------------------------

    -The DOF for Table DTS_FORM_SAMPLE

    --------------------------------------------------------

    CREATE TABLE 'DTS_FORM_SAMPLE '.

    (NUMBER OF 'ID',

    VARCHAR2 (20) "CLOCK_NUMBER."

    NUMBER OF 'EMP_ID,'

    NUMBER OF "REPORT_TYPE."

    DATE OF THE "SUB_DATE.

    ) ;

    /

    INSERTION of REM in DTS_FORM_SAMPLE

    TOGETHER TO DEFINE

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2896, 'XX2444', 12810,1, to_date('02-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2897, 'XX2444', 12810,1, to_date('09-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2898, 'XX2444', 12810,1, to_date('16-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2899, 'XX2444', 12810,1, to_date('23-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2900, 'XX2444', 12810,1, to_date('30-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2901, 'XX2444', 12810,1, to_date('05-MAR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2902, 'XX2444', 12810,1, to_date('12-MAR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2903, 'XX2444', 12810,1, to_date('19-MAR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2904, 'XX2444', 12810,1, to_date('26-MAR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2920, 'XX2444', 12810,1, to_date('19-FEB-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2921, 'XX2444', 12810,1, to_date('22-JAN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2922, 'XX2444', 12810,1, to_date('05-FEB-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2923, 'XX2444', 12810,1, to_date('26-FEB-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2924, 'XX2444', 12810,1, to_date('29-JAN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2925, 'XX2444', 12810,1, to_date('12-FEB-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (2965, 'XX2444', 12810,1, to_date('30-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6970, 'XX2444', 12810,1, to_date('18-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6971, 'XX2444', 12810,1, to_date('25-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6972, 'XX2444', 12810,1, to_date('04-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6973, 'XX2444', 12810,1, to_date('11-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6978, 'XX2444', 12810,1, to_date('14-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6979, 'XX2444', 12810,1, to_date('21-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6980, 'XX2444', 12810,1, to_date('28-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6981, 'XX2444', 12810,1, to_date('07-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6948, 'XX2444', 12810,1, to_date('06-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6957, 'XX2444', 12810,1, to_date('09-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6958, 'XX2444', 12810,1, to_date('16-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6959, 'XX2444', 12810,1, to_date('23-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6960, 'XX2444', 12810,1, to_date('02-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8938, 'XX2444', 12810,1, to_date('14-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8939, 'XX2444', 12810,1, to_date('21-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8940, 'XX2444', 12810,1, to_date('28-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8941, 'XX2444', 12810,1, to_date('07-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8942, 'XX2444', 12810,1, to_date('14-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8943, 'XX2444', 12810,1, to_date('21-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8977, 'XX2444', 12810,1, to_date('04-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8978, 'XX2444', 12810,1, to_date('11-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8979, 'XX2444', 12810,1, to_date('11-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8980, 'XX2444', 12810,1, to_date('18-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8981, 'XX2444', 12810,1, to_date('18-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8982, 'XX2444', 12810,1, to_date('25-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8983, 'XX2444', 12810,1, to_date('25-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8984, 'XX2444', 12810,1, to_date('02-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8985, 'XX2444', 12810,1, to_date('02-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8953, 'XX2444', 12810,1, to_date('19-FEB-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9824, 'XX2444', 12810,1, to_date('20-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9825, 'XX2444', 12810,1, to_date('20-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9826, 'XX2444', 12810,1, to_date('20-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8972, 'XX2444', 12810,1, to_date('30-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8973, 'XX2444', 12810,1, to_date('30-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8974, 'XX2444', 12810,1, to_date('07-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8975, 'XX2444', 12810,1, to_date('28-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8951, 'XX2444', 12810,1, to_date('12-FEB-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8952, 'XX2444', 12810,1, to_date('19-FEB-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8954, 'XX2444', 12810,1, to_date('26-FEB-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8955, 'XX2444', 12810,1, to_date('26-FEB-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8956, 'XX2444', 12810,1, to_date('05-MAR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8957, 'XX2444', 12810,1, to_date('05-MAR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8958, 'XX2444', 12810,1, to_date('12-MAR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8959, 'XX2444', 12810,1, to_date('12-MAR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8960, 'XX2444', 12810,1, to_date('19-MAR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8961, 'XX2444', 12810,1, to_date('19-MAR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8962, 'XX2444', 12810,1, to_date('26-MAR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8963, 'XX2444', 12810,1, to_date('26-MAR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8964, 'XX2444', 12810,1, to_date('02-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8965, 'XX2444', 12810,1, to_date('02-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8966, 'XX2444', 12810,1, to_date('09-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8967, 'XX2444', 12810,1, to_date('09-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8968, 'XX2444', 12810,1, to_date('16-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8969, 'XX2444', 12810,1, to_date('16-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8970, 'XX2444', 12810,1, to_date('23-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8971, 'XX2444', 12810,1, to_date('23-APR-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8976, 'XX2444', 12810,1, to_date('04-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8986, 'XX2444', 12810,1, to_date('09-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8987, 'XX2444', 12810,1, to_date('09-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9041, 'XX2444', 12810,1, to_date('16-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9042, 'XX2444', 12810,1, to_date('16-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9043, 'XX2444', 12810,1, to_date('23-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9044, 'XX2444', 12810,1, to_date('23-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9045, 'XX2444', 12810,1, to_date('30-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9046, 'XX2444', 12810,1, to_date('30-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9047, 'XX2444', 12810,1, to_date('06-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9048, 'XX2444', 12810,1, to_date('06-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8944, 'XX2444', 12810,1, to_date('22-JAN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8945, 'XX2444', 12810,1, to_date('22-JAN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8946, 'XX2444', 12810,1, to_date('29-JAN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8947, 'XX2444', 12810,1, to_date('29-JAN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8948, 'XX2444', 12810,1, to_date('05-FEB-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8949, 'XX2444', 12810,1, to_date('05-FEB-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (8950, 'XX2444', 12810,1, to_date('12-FEB-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9527, 'XX2444', 12810,1, to_date('13-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9528, 'XX2444', 12810,1, to_date('13-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (9529, 'XX2444', 12810,1, to_date('13-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6739, 'YY7223', 11093,8, to_date('15-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6740, 'YY7223', 11093,8, to_date('21-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6741, 'YY7223', 11093,8, to_date('22-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6742, 'YY7223', 11093,8, to_date('25-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6743, 'YY7223', 11093,8, to_date('26-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6744, 'YY7223', 11093,8, to_date('27-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6745, 'YY7223', 11093,1, to_date('04-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6746, 'YY7223', 11093,1, to_date('11-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6747, 'YY7223', 11093,1, to_date('18-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6748, 'YY7223', 11093,1, to_date('25-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6749, 'YY7223', 11093,11, to_date('01-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6750, 'YY7223', 11093,11, to_date('15-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (6751, 'YY7223', 11093,10, to_date('01-JUL-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (11017, 'YY7223', 11093,1, to_date('07-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (11018, 'YY7223', 11093,1, to_date('14-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (11019, 'YY7223', 11093,1, to_date('21-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (11020, 'YY7223', 11093,1, to_date('28-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (11021, 'YY7223', 11093,1, to_date('04-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (11022, 'YY7223', 11093,1, to_date('11-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (11023, 'YY7223', 11093,1, to_date('18-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (11024, 'YY7223', 11093,1, to_date('25-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (11025, 'YY7223', 11093,10, to_date('31-MAY-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (11026, 'YY7223', 11093,10, to_date('30-JUN-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13115, 'YY7223', 11093,1, to_date('13-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13201, 'YY7223', 11093,1, to_date('20-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13287, 'YY7223', 11093,1, to_date('27-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13373, 'YY7223', 11093,10, to_date('08-SEP-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13489, 'YY7223', 11093,8, to_date('01-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13490, 'YY7223', 11093,8, to_date('02-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13491, 'YY7223', 11093,8, to_date('03-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13492, 'YY7223', 11093,8, to_date('04-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13493, 'YY7223', 11093,8, to_date('05-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13494, 'YY7223', 11093,8, to_date('06-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13495, 'YY7223', 11093,8, to_date('07-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13496, 'YY7223', 11093,8, to_date('08-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13497, 'YY7223', 11093,8, to_date('09-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13498, 'YY7223', 11093,8, to_date('10-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13499, 'YY7223', 11093,8, to_date('11-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13500, 'YY7223', 11093,8, to_date('12-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13501, 'YY7223', 11093,8, to_date('13-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13502, 'YY7223', 11093,8, to_date('14-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13503, 'YY7223', 11093,8, to_date('15-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13504, 'YY7223', 11093,8, to_date('16-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13505, 'YY7223', 11093,8, to_date('17-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13506, 'YY7223', 11093,8, to_date('18-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13507, 'YY7223', 11093,8, to_date('19-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13508, 'YY7223', 11093,8, to_date('20-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13509, 'YY7223', 11093,8, to_date('21-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13510, 'YY7223', 11093,8, to_date('22-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13511, 'YY7223', 11093,8, to_date('23-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13512, 'YY7223', 11093,8, to_date('24-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13513, 'YY7223', 11093,8, to_date('25-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13514, 'YY7223', 11093,8, to_date('26-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13515, 'YY7223', 11093,8, to_date('27-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13516, 'YY7223', 11093,8, to_date('28-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13517, 'YY7223', 11093,8, to_date('29-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13518, 'YY7223', 11093,8, to_date('30-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13519, 'YY7223', 11093,8, to_date('31-AUG-15','DD-MON-RR'));

    Insert into DTS_FORM_SAMPLE (ID, CLOCK_NUMBER, EMP_ID, REPORT_TYPE, SUB_DATE) values (13030, 'YY7223', 11093,1, to_date('06-AUG-15','DD-MON-RR'));

    --------------------------------------------------------

    -Table DTS_FORM_SAMPLE constraints

    --------------------------------------------------------

    CHANGE ALTER TABLE 'DTS_FORM_SAMPLE' ('ID' ENABLE NOT NULL);

    /

    Or more simple:

    Select emp_id, w.wk, to_char (wk, 'ww') x

    from (select trunc (date ' 2015-01-01' + 7 * (level - 1), 'ww') wk)

    of the double

    connect by level<=>

    ) o

    left outer join

    s dts_form_sample

    by (emp_id) partition

    We trunc (s.sub_date, 'ww') = w.wk

    where sub_date is null

    order to emp_id,

    x

    /

    EMP_ID WK X
    ---------- --------- --
    11093 1ST JANUARY 15 01
    11093 8 JANUARY 15 02
    11093 15 JANUARY 15 03
    11093 22 JANUARY 15 04
    11093 29 JANUARY 15 05
    11093 5 FEBRUARY 15 06
    11093 12 FEBRUARY 15 07
    11093 19 FEBRUARY 15 08
    11093 26 FEBRUARY 15 09
    11093 5 MARCH 15 10
    11093 12 MARCH 15 11

    EMP_ID WK X
    ---------- --------- --
    11093 19 MARCH 15 12
    11093 26 MARCH 15 13
    11093 2 APRIL 15 14
    11093 9 APRIL 15 15
    11093 16 APRIL 15 16
    11093 23 APRIL 15 17
    11093 30 APRIL 15 18
    11093 37 15 - SEP - 10
    17-SEVEN 11093.-15 38
    24-SEVEN 11093.-15 39
    11093 1 OCTOBER 15 40

    EMP_ID WK X
    ---------- --------- --
    11093 8 OCTOBER 15 41
    11093 15 OCTOBER 15 42
    11093 22 OCTOBER 15 43
    11093 29 OCTOBER 15 44
    11093 5 NOVEMBER 15 45
    11093 12 NOVEMBER 15 46
    11093 19 NOVEMBER 15 47
    11093 26 NOVEMBER 15 48
    11093 3 DECEMBER 15 49
    11093 10 DECEMBER 15 50
    11093 17 DECEMBER 15 51

    EMP_ID WK X
    ---------- --------- --
    11093 24 DECEMBER 15 52
    11093 31 DECEMBER 15 53
    12810 1ST JANUARY 15 01
    12810 8 JANUARY 15 02
    12810 15 JANUARY 15 03
    12810 27 AUGUST 15 35
    12810 15 - SEP - 03 36
    12810 37 15 - SEP - 10
    17-SEVEN 12810.-15 38
    24-SEVEN 12810.-15 39
    12810 1 OCTOBER 15 40

    EMP_ID WK X
    ---------- --------- --
    12810 8 OCTOBER 15 41
    12810 15 OCTOBER 15 42
    12810 22 OCTOBER 15 43
    12810 29 OCTOBER 15 44
    12810 5 NOVEMBER 15 45
    12810 12 NOVEMBER 15 46
    12810 19 NOVEMBER 15 47
    12810 26 NOVEMBER 15 48
    12810 3 DECEMBER 15 49
    12810 10 DECEMBER 15 50
    12810 17 DECEMBER 15 51

    EMP_ID WK X
    ---------- --------- --
    12810 24 DECEMBER 15 52
    12810 31 DECEMBER 15 53

    57 selected lines.

    SQL >

    However OP question must answer is start of week date.

    SY.

  • GROUP BY date range to identify duplicates revisited!

    Good afternoon

    It is a continuation of the previous discussion, I previously created GROUP BY date range to identify duplicates

    Your help with the following would be appreciated (examples of data below)

    I've highlighted what I mark as returned to double as below:

    example4.jpg

    Definition of duplicate (However, this is slightly different to the previous post)

    the same account_num

    maximum 20 days apart tran_effective_date

    tran_processed_date maximum 10 days apart

    the same tran_amount

    However, I do not want to return a duplicate if they have both a tran_priced_date filled.

    So, in light of the foregoing, I don't expect the following account_numbers to be marked as duplicate:

    N100283 - one of the records has populated trab_priced_date

    N101640 - none of the records have the tran_priced_date filled

    N102395 - same as N101640

    N102827 - same as N101640

    N108876 - although the two documents have the populated tran_priced_date, the tran_effective_dates are more than 20 days apart.

    BUT for the rest of the accounts, N100284 and N102396 I want to execute the following logic

    Compare the 3rd rank in 4th place and ask the following questions:

    Is tran_effective_date to a maximum of 20 days out?

    Is tran_processed_date maximum 10 days apart?

    If yes then report it as dupe

    Compare line 4 to 5, then ask the same question until you get to the line 4 or 5. When everything is done, I want to examine only the transactions that have the status of normal and if the above question is true for both and then return to my game of result as dupes.

    I hope that makes sense!

    BEGIN
      EXECUTE IMMEDIATE 'DROP TABLE samp_data';
    EXCEPTION
      WHEN OTHERS THEN
        IF SQLCODE = -942 THEN
          DBMS_OUTPUT.put_line('');
        ELSE
          RAISE;
        END IF;
    END;
    /
    
    
    CREATE TABLE samp_data (
      ACCOUNT_NUM             VARCHAR2(17),
      TRAN_ID                 NUMBER(10),
      TRAN_TYPE               VARCHAR2(50),
      TRAN_EFFECTIVE_DATE     TIMESTAMP(6),
      TRAN_PROCESSED_DATE     TIMESTAMP(6),
      TRAN_STATUS             VARCHAR2(17),
      TRAN_PRICED_DATE        TIMESTAMP(6),
      TRAN_AMOUNT             NUMBER(13,2)
      );
    /
    
    
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N100283',140119178,'Regular With',to_timestamp('01-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('22-MAY-15 07.00.34.235000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Normal', to_timestamp('21-MAY-15 03.26.18.954000000 AM','DD-MON-RR HH.MI.SS.FF AM'),200);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE,TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N100283',140158525,'Regular With',to_timestamp('13-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('26-MAY-15 08.39.14.090000000 AM','DD-MON-RR HH.MI.SS.FF AM'),'Normal', null,200);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N100284',140118826,'Regular With',to_timestamp('03-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('22-MAY-15 07.00.19.072000000 AM','DD-MON-RR HH.MI.SS.FF AM'),'Normal', to_timestamp('20-MAY-15 03.25.05.438000000 AM','DD-MON-RR HH.MI.SS.FF AM'),450);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N100284',140158120,'Regular With',to_timestamp('06-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('23-MAY-15 08.38.42.064000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Reversed', to_timestamp('21-MAY-15 03.26.18.954000000 AM','DD-MON-RR HH.MI.SS.FF AM'),450);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N100284',140158120,'Regular With',to_timestamp('06-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('02-JUN-15 08.38.42.064000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Normal', to_timestamp('31-MAY-15 03.26.18.954000000 AM','DD-MON-RR HH.MI.SS.FF AM'),450);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N101640',140118957,'Regular With',to_timestamp('18-MAY-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('22-MAY-15 07.00.25.015000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Normal', null,120);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N101640',140158278,'Regular With',to_timestamp('22-MAY-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('26-MAY-15 08.38.56.228000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Normal', null,130);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N102395',140118842,'Regular With',to_timestamp('03-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('22-MAY-15 07.00.19.665000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Normal', null,250);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N102395',140158235,'Regular With',to_timestamp('03-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('26-MAY-15 08.38.53.093000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Normal', null,250);
    
    
    
    
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N102396',140118823,'Regular With',to_timestamp('09-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('18-MAY-15 07.00.18.931000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Normal', to_timestamp('19-MAY-15 03.26.18.954000000 AM','DD-MON-RR HH.MI.SS.FF AM'),750);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N102396',140158099,'Regular With',to_timestamp('16-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('24-MAY-15 08.38.39.443000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Reversed', to_timestamp('21-MAY-15 03.26.18.954000000 AM','DD-MON-RR HH.MI.SS.FF AM'),750);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N102396',140158099,'Regular With',to_timestamp('16-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('29-MAY-15 08.38.39.443000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Normal', to_timestamp('30-MAY-15 03.26.18.954000000 AM','DD-MON-RR HH.MI.SS.FF AM'),750);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N102396',140158099,'Regular With',to_timestamp('12-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('22-MAY-15 08.38.39.443000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Reversed', to_timestamp('30-MAY-15 03.26.18.954000000 AM','DD-MON-RR HH.MI.SS.FF AM'),750);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N102396',140158099,'Regular With',to_timestamp('14-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('23-MAY-15 08.38.39.443000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Reversed', to_timestamp('30-MAY-15 03.26.18.954000000 AM','DD-MON-RR HH.MI.SS.FF AM'),750);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N102827',140118850,'Regular With',to_timestamp('03-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('22-MAY-15 07.00.20.045000000 AM','DD-MON-RR HH.MI.SS.FF AM') , 'Normal',null,157.84);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N102827',140158118,'Regular With',to_timestamp('03-JUN-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('26-MAY-15 08.38.41.861000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Normal', null,157.84);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N108876',139840720,'Regular With',to_timestamp('01-MAY-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('11-MAY-15 08.35.34.646000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Normal', to_timestamp('20-MAY-15 03.25.05.438000000 AM','DD-MON-RR HH.MI.SS.FF AM'),1000);
    Insert into samp_data (ACCOUNT_NUM,TRAN_ID,TRAN_TYPE,TRAN_EFFECTIVE_DATE,TRAN_PROCESSED_DATE, TRAN_STATUS, TRAN_PRICED_DATE,TRAN_AMOUNT) 
    values ('N108876',139889880,'Regular With',to_timestamp('22-MAY-15 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'),to_timestamp('12-MAY-15 08.49.29.080000000 AM','DD-MON-RR HH.MI.SS.FF AM'), 'Normal', to_timestamp('21-MAY-15 03.26.18.954000000 AM','DD-MON-RR HH.MI.SS.FF AM'),1000);
    /
    
    
    select * from samp_data
    ORDER BY account_num, tran_effective_date, tran_processed_date;
    

    PL continue the discussion in your original post

  • Date range prompt--Null default value

    Hello

    It is a follow-up on post Date invites default NULL

    I have a similar case but using database directly request the report and have implemented a variable presentation with two date ranges. I want to leave the default value of the date white values in the dash prompt, but have the ability to enter values in the other guests and ignore the date of the application

    I have 4 variables of presentation being placed in the SQL query, two of which are the date ranges (between)

    I use OBIEE 10.3.1.4, is there a workaround to run the report using the other prompt values and ignoring the date values null?

    Hello

    Keep your 1900 filter in report itself and no default value chosen at the prompt. If this value is not visible in the dashboard and it will fly too when the user selects a value from the command prompt.

    Thank you

    AJ

  • Date range search

    Hello
    Filtering data for a specific date range does not give the desired result. Currently, the column is a column varchar2.

    Then under query should display the records only 2 for the range of data between 01/01/2013, but his displays all records. Please notify.

    Sample data:


    create table Records_test (B_Recorded_Date VARCHAR2 (4000 BYTE))

    insert into Records_test values('12/04/2013');
    insert into Records_test values('7/25/2000');
    insert into Records_test values('10/30/2003');
    insert into Records_test values('9/5/2006');
    insert into Records_test values('12/5/1994');
    insert into Records_test values('12/19/2013');
    insert into Records_test values('9/4/1992');
    insert into Records_test values('8/7/2007');
    insert into Records_test values('9/28/2005');
    insert into Records_test values('12/10/2004');
    insert into Records_test values('11/28/2011');

    Select * from Records_test
    where
    (
    TO_CHAR (TO_date (substr (B_Recorded_Date, 0, 10), ' MM/DD/YYYY'), ' MM/DD/YYYY') > = to_char (to_date('07/01/2013','MM/DD/YYYY'), ' MM/DD/YYYY')
    and to_char (TO_date (substr (B_Recorded_Date, 0, 10), ' MM/DD/YYYY'), ' MM/DD/YYYY') < to_char (to_date('12/31/2013','MM/DD/YYYY'), ' MM/DD/YYYY')
    )

    04/12/2013
    25/07/2000
    30/10/2003
    05/09/2006
    05/12/1994
    19/12/2013
    04/09/1992
    08/07/2007
    28/09/2005
    10/12/2004
    28/11/2011

    Thank you.

    Hello user7988

    Try this:

    SELECT *.

    OF Records_test

    WHERE

    TO_date (substr (B_Recorded_Date, 0, 10), ' MM/DD/YYYY') > = TO_DATE('07/01/2013','MM/DD/YYYY')

    AND TO_date (substr (B_Recorded_Date, 0, 10), ' MM/DD/YYYY')<>

    ;

    The best way if you set this column as DATE, then there is no need to convert your varchar value date.

    Kind regards
    David

  • Need help | How to clear the filter of af values: table on table linen

    Hello

    JDeveloper version 11.1.1.7

    I have af:table inside a taskflow to which has been added to several pages as a region.

    The problem I'm facing is if I enter any value in current input for the data in the column filtering and if I navigate to another page that has even added taskflow as a region filter values is still visible.

    How can I clear the values entered in the input of the filter text.

    code fragment:

    < af:table value = "#{bindings." BulletinDataVO21.collectionModel}.

    Binding = "#{pageFlowScope.bulletinArchieveBean.bulletinTable} '"

    var = "row".

    lines = ' #{bindings. " BulletinDataVO21.rangeSize}.

    emptyText = "#{bindings." BulletinDataVO21.viewable? "{customtaskflowsBundle ['table.no.data.to.display']: customtaskflowsBundle ['table.access.denied']}."

    fetchSize = "#{bindings." BulletinDataVO21.rangeSize}.

    filterModel = "#{bindings." BulletinDataVO21Query.queryDescriptor}.

    queryListener = "#{pageFlowScope.bulletinArchieveBean.onQuery} '"

    filterVisible = "true" varStatus = "vs."

    rowBandingInterval = "0" id = "t1".

    styleClass = "datatable_inside_wrapper."

    autoHeightRows = "25" width = "700" >

    the queryListener at the bean code:

    {} public void onQuery (QueryEvent queryEvent)

    QPF FilterableQueryDescriptor =

    (FilterableQueryDescriptor) queryEvent.getDescriptor ();

    Map map < String, Object > = fqd.getFilterCriteria ();

    If (log.isDebugEnabled ()) {}

    {for (String key: {map.keySet ())}

    log. Debug ("touch of filter criteria:" + key + ", value:" +)

    Map.get('zoom') (Key));

    }

    }

    final String publishingFromKey = "Publishingfromdate";

    final String publishingToKey = "Publishingtodate";

    Object publishingFrom = map.get('zoom') (publishingFromKey);

    Object publicationdans = map.get('zoom') (publishingToKey);

    String titleValue = (String) map.get('zoom') ("Value");

    If (StringUtils.isNotEmpty (titleValue)) {}

    Map.put ("Value", "%" + titleValue + '%');

    }

    String targetDepts = (String) map.get('zoom') ("Targetdepts");

    If (StringUtils.isNotEmpty (targetDepts)) {}

    Map.put ("Targetdepts", '%' + targetDepts + '%');

    }

    Category String = (String) map.get('zoom') ("Category");

    If (StringUtils.isNotEmpty (category)) {}

    Map.put ("Category", "%" + category + '%');

    }

    DCBindingContainer links =

    (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();

    OperationBinding = setPublishingFromDateStartOperationBinding

    bindings.getOperationBinding ("setPublishingFromDateStart");

    OperationBinding = setPublishingToDateEndOperationBinding

    bindings.getOperationBinding ("setPublishingToDateEnd");

    setPublishingFromDateStartOperationBinding.getParamsMap () .put ("value",

    publishingFrom);

    setPublishingToDateEndOperationBinding.getParamsMap () .put ("value",

    Publicationdans);

    Map.Remove (publishingFromKey);

    Map.Remove (publishingToKey);

    setPublishingFromDateStartOperationBinding.execute ();

    setPublishingToDateEndOperationBinding.execute ();

    DcIteratorBinding = DCIteratorBinding

    bindings.findIteratorBinding ("BulletinDataVO2Iterator");

    ViewObjectImpl = bulletinVO

    (ViewObjectImpl) dcIteratorBinding.getViewObject ();

    final String publishingFromCriteria = "QueryByPublishingFromDate";

    final String publishingToCriteria = "QueryByPublishingToDate";

    If (publishingFrom! = null) {}

    bulletinVO.setApplyViewCriteriaName (publishingFromCriteria, true);

    } else {}

    bulletinVO.removeApplyViewCriteriaName (publishingFromCriteria);

    }

    If (publicationdans! = null) {}

    bulletinVO.setApplyViewCriteriaName (publishingToCriteria, true);

    } else {}

    bulletinVO.removeApplyViewCriteriaName (publishingToCriteria);

    }

    JSFUtils.invokeMethodExpression ("#{bindings.") BulletinDataVO21Query.processQuery} «»

    Object.Class, QueryEvent.class,

    queryEvent);

    Map.put ("Value", titleValue);

    Map.put ("Targetdepts", targetDepts);

    Map.put ("Category", category);

    Map.put (publishingFromKey, publishingFrom);

    Map.put (publishingToKey, publicationdans);

    }

    Please let me know we can clear the values entered in input boxes of text for filtering on whenever the load table.

    Thank you

    Madhukar

    Hi all

    I could solve the problem.

    Clear the fault and implicit criteria VO display!

    Here's the code to do the same.

    Hope it will be useful for others as well, also let me know if this can be done in the best way.

    Bean code:

    DCBindingContainer links =

    (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();

    DCIteratorBinding data binding =.

    bindings.findIteratorBinding ("TestDataView1Iterator");

    If (dataBinding! = null) {}

    ViewObjectImpl = testDataVO

    (ViewObjectImpl) dataBinding.getViewObject ();

    testDataVO.reset ();

    The below two lines code clears the default and display implicit criteris

    which gets set in ViewCriteriaManager when we filter the data in the table to help

    This table filter text box in the column af:table headings

    NOTE: It will not erase the other criteria of which are defined by users in VO

    testDataVO.getViewCriteriaManager () .removeViewCriteria (ViewCriteriaManager.DFLT_VIEW_CRITERIA_NAME);

    testDataVO.getViewCriteriaManager () .removeViewCriteria (ViewCriteriaManager.IMPLICIT_VIEW_CRITERIA_NAME);

    If (param.equalsIgnoreCase ("home")) {}

    testDataVO.setWhereClause ("attachment = 'Y'");

    } else {}

    testDataVO.setWhereClause ("attachment = ' n '");

    }

    testDataVO.executeQuery ();

    }

    Thank you all for the suggestions.

    Thank you

    Madhukar

  • Date ranges query

    Hi Experts,

    A very happy new year to all of you (a little in advance)!

    I have a table where I have the id of employee and the task assigned with the start dates and end dates. Overlap in the dates of the tasks is a data delivers however I know how to spot them and eliminate. There is therefore no date of tasks that overlap

    Employee_id

    Task_No

    Task_Start_date

    Task_End_Date

    Examples of data

    1 T1 1 January 2014 February 28, 2014

    1 T2 March 1, 2014 31 December 2014

    2 T1 23 January 2014 31 December 2014

    2 T2 1 January 2015 December 31, 2073 (means end of time)

    3 T3 1 January 2014 July 15, 2014

    3 T4 August 1, 2014 31 December 2014

    T5 4 1 January 2014 December 31, 2073

    I want to design a query where I provide the end date and it will list all the employees that are free for the same day from 1 January 2014. Thus, for example, if I give December 31, 2014, it will list the

    EmpId (first day where the employee is free)

    2 January 1, 2014

    3 July 16, 2014

    If I give the end = end date of time(31-Dec-2013), result-

    EmpId (first day where the employee is free)

    1 January 1, 2015

    2 January 1, 2014

    3 July 16, 2014

    If I give the end = date January 31, 2014, expected - result

    EmpId (first day where the employee is free)

    1 January 1, 2015

    I conceived after the request, but he intercepted not 2 employee ID. Also, it provides no flexibility to change end date-

    Select *.

    from (select employe_id,

    task_start_date,

    task_end_date,

    lag (task_end_date, 1, task_start_date) on prev_end_date (partition by employee_id arrested by task_start_date)

    of shop.employee_tasks

    where task_end_date > = trunc (sysdate))

    where task_start_date - prev_end_date > 1

    Thanks in advance!

    Kind regards

    This is an example of what I call the query 'free time': you have the dates when you are busy and you want the dates where you are free.

    You can find a nice solution for the problem of base here: ask Tom "SQL Query to find gaps in the date ranges" (search for solution of Anthony Boucher). Please note that this solution works even with the date ranges overlap.

    To apply the solution here, first create the test data (please do it yourself in the following questions).

    create table t(Employee_id, task_no, Task_Start_date, task_end_date)
    as select
    1, 'T1', to_date('01-jan-2014'), to_date('28-feb-2014') from dual union all select
    1, 'T2', to_date('01-Mar-2014'), to_date('31-Dec-2014') from dual union all select
    2, 'T1', to_date('23-jan-2014'), to_date('31-dec-2014') from dual union all select
    2, 'T2', to_date('01-jan-2015'), to_date('31-dec-2073') from dual union all select
    3, 'T3', to_date('01-jan-2014'), to_date('15-jul-2014') from dual union all select
    3, 'T4', to_date('01-aug-2014'), to_date('31-dec-2014') from dual union all select
    4, 'T5', to_date('01-Jan-2014'), to_date('31-Dec-2073') from dual;
    

    In the query, you must add records for yesterday and for the "end date" you want. This allows you to "free time" before and after the date ranges in your table.

    Now, you partition by order of Task_Start_date and employe_id. Using the analytical function of the max (task_end_date), you get the last date of end so far. Add 1 and you get the first time (maybe). To make sure that the date is free, it must be before the next start date.

    variable end_date varchar2(64)
    exec :end_date := '31-Dec-2073';
    --
    with boundaries as (
      select trunc(sysdate)-1 task_start_date, trunc(sysdate)-1 task_end_date from dual
      union all
      select to_date(:end_date)+1, to_date(:end_date)+1 from dual
    ), data as (
      select * from t
    where task_end_date >= trunc(sysdate)
      and task_start_date < :end_date
      union all
      select distinct a.employee_id, null, b.task_start_date, b.task_end_date
      from t a, boundaries b
    )
    select employee_id, min(free_start) free_start
    from (
      select employee_id,
      max(task_end_date) over (partition by employee_id order by task_start_date)+1 free_start,
      lead(task_start_date) over (partition by employee_id order by task_start_date)-1 free_end
      from data
    )
    where free_start <= free_end
    group by employee_id;
    
    EMPLOYEE_ID FREE_START
    1 JANUARY 1, 15
    2 1 JANUARY 14
    3 16 JULY 14

Maybe you are looking for

  • iCloud photo sharing

    I have a Mac with if El Capitan. My photos on this computer are in a shared file with another user on the same computer. When I try to use photo sharing he does not recognize the shared files and is not download storage iCloud. What should do?

  • My download of flash player will not run

    I uninstalled my adobe flash player by mistake.  I tried to reinstall and download said full, but I can't in my control panel and it does not seem you run as videos will not play.  Try to play a video, I get an error message that I need the flashplay

  • Restore a file from a backup made in XP Home

    Hi, I am trying to access an external hard drive that contains a backup made on a PC, hard drive now crashed, which was on XP Home. Tried of all kinds, including checking the box removable storage management. MSG I get, is that Windows is lying to fi

  • How to remove and reset the Contacts folder / files in Vista Windows Mail

    How can I delete the Contacts in Vista - and actually reset the folder so that windows treats the files ".contact" as - good contact and no text. Because what was going on, I decided to try to start from scratch - I just copied all the files in the f

  • Disable the design standard suite CS3 after lost original programs

    Hello, so I deleted the software of the standard cs3 design suite to reinstall. However, I do not disable the software before doing so, and now I can't active my serial number on the new software. How should I do to disable the serial number so I can