including min (date change) data results

I get the following error message when you try to use the function min to a modified date of my data:
ORA-00934: Group feature is not allowed here

I try to get the counts of incidents closed each month. However, Incidents can be closed, then reopened and closed.
So based on my criteria, an Incident which was closed in 2009 (which does not fall into my criteria) may still appear in my data because it may have been reopened and closed again in 2010 (which does not fit my criteria).
"I want to only count when the minimum (modified_date) > = January 1, 2010"

_ Here is my SQL
 
SELECT COUNT (
                      A.INCIDENT_NUMBER
                             || '-'
                             || A.CASE_NUMBER
                             || '-'
                             || a.part_sequence)
                    AS Qty_Closed,
                 (CASE
                     WHEN a.COMPLAINT = 'Y'
                     THEN
                        DECODE (RDC.REPORTED_DEV_CLARIFICATION,
                                '2524 - AV - No PI;', 'NO PI',
                                'Complaint')
                     ELSE
                        'Non Complaint'
                  END)
                    AS Classification,
                 TO_DATE (TO_CHAR (NAH.MODIFIED_DATE, 'Mon-YYYY'), 'Mon-YYYY')
                    AS Closed_month
            FROM  chsuser.a_compl_summary a,
                 chsuser.rp_qa_reported_device_codes rdc,
                 CHSUSER.NEXT_ACTION_HISTORY NAH
           WHERE     a.incident_number = rdc.incident_number
                 AND a.case_number = rdc.case_number
                 AND a.part_sequence = rdc.part_sequence
                 AND A.INCIDENT_NUMBER = NAH.INCIDENT_NUMBER
                 AND A.CASE_NUMBER = NAH.CASE_NUMBER
                 AND min(NAH.MODIFIED_DATE) >= '01-JAN-2010'
                 AND NAH.TO_GROUP = 'CLOSE'                     
        GROUP BY (CASE
                     WHEN a.cOMPLAINT = 'Y'
                     THEN
                        DECODE (RDC.REPORTED_DEV_CLARIFICATION,
                                '2524 - AV - No PI;', 'NO PI',
                                'Complaint')
                     ELSE
                        'Non Complaint'
                  END),
                 TO_DATE (TO_CHAR (NAH.MODIFIED_DATE, 'Mon-YYYY'),
                          'Mon-YYYY')
Published by: davidredden1973 on October 19, 2011 11:47

Have you tried to use the clause?

 HAVING min(NAH.MODIFIED_DATE) >= '01-JAN-2010'

Tags: Database

Similar Questions

  • Mini Data Center design

    Hello

    I have a few doubts about the best solution for the design of a mini data center.

    In the data center, there is a 6500 with FWSM module installed, there are a few created vlans, each of them in the fwsm module. For example, a back-end to communicate with a server in the front end server must always go through the firewall. My question is, these flows through the firewall that does not reduce the speed of communication?

    What is the best practice, just to pass the communications with the Wan in the firewall, and the communication of vlan between front-end and back-end is only set up to 6500?

    Thank you

    Although security is a subject with many facets. How to fix you can do things depends on part on your needs to provide the functionality for the application to work.

    If the database servers do not need to Internet, just keep on a VLAN internal only and do not allow to be routed even initialized requests internally by. If the database servers have need to talk to the Internet (why is this really necessary would be a good question to ask - a bastion host could be used instead?), then lock the rules in the FWSM with an access list that allows only addresses and ports as necessary for the minimum necessary service work.

    In any scenario, your should analyse your servers (for example with Nessus) and harden to reduce their exposed attack surface. Additional measures could include things like Tripwire on the servers to block further down. Audit of system access - and actually looking at the newspapers! -also helps. Tools such as iptables on Linux or Windows Firewall servers must be a lever to allow only the communications in and out of the box as necessary so that it can perform its designated function.

  • How to calculate the load time, max - min date query

      CREATE TABLE TEST ( GID VARCHAR2(100 BYTE), SGID VARCHAR2(100 BYTE), PID VARCHAR2(100 BYTE), DATES TIMESTAMP (6) );
    
    REM INSERTING into TEST
    SET DEFINE OFF;
    Insert into TEST (GID,SGID,PID,DATES) values ('1','1000','ABC',to_timestamp('24-AUG-13 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into TEST (GID,SGID,PID,DATES) values ('1','1001','BCD',to_timestamp('24-AUG-13 05.21.46.491000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into TEST (GID,SGID,PID,DATES) values ('1','1002','CDE',to_timestamp('24-AUG-13 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into TEST (GID,SGID,PID,DATES) values ('2','1004','EDF',to_timestamp('23-AUG-13 05.22.20.000000000 PM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into TEST (GID,SGID,PID,DATES) values ('2','1003','FEG',to_timestamp('24-AUG-13 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into TEST (GID,SGID,PID,DATES) values ('2','1001','GHI',to_timestamp('24-AUG-13 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into TEST (GID,SGID,PID,DATES) values ('2','1006','JKL',to_timestamp('24-AUG-13 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into TEST (GID,SGID,PID,DATES) values ('3','1007','LMN',to_timestamp('24-AUG-13 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'));
    Insert into TEST (GID,SGID,PID,DATES) values ('3','1001','OPQ',to_timestamp('24-AUG-13 12.00.00.000000000 AM','DD-MON-RR HH.MI.SS.FF AM'));
    

    Hello

    I need a sql query which gives me the time taken to load the records ie., Max date less date min. I ran a query that gives me the result "0 23:59:26.491" below.

    select (max(DATES) - min(DATES)) from test;
    

    When I apply the same logic in Peoplesoft enterprise manager, it generates the sub query and throw me the "ORA-01722: invalid number" error.

    select max(TO_CHAR(cast((DATES) as timestamp),'YYYY-MM-DD-HH24.MI.SS.FF'))
    -min(TO_CHAR(cast((DATES) as timestamp),'YYYY-MM-DD-HH24.MI.SS.FF'))
    from test; 
    

    Can you please modify the above query?

    user11872870 wrote:

    1. CREATE TABLE TEST (VARCHAR2(100 BYTE), VARCHAR2(100 BYTE), PID VARCHAR2 (100 BYTE) SGID GID, DATES TIMESTAMP (6));
    2. INSERTION of REM in TEST
    3. TOGETHER TO DEFINE
    4. Insert into TEST (GID, SGID, PID, DATES) values ('1 ', ' 1000', 'ABC', to_timestamp (12.00.00.000000000 AM Aug 24, 13 ',' DD-MON-RR HH.MI.)) SS. AM FF '));
    5. Insert into TEST (GID, SGID, PID, DATES) values ('1 ', ' 1001', "BCD", to_timestamp (24 August 13 05.21.46.491000000 PM ',' DD-MON-RR HH.MI.)) SS. AM FF '));
    6. Insert into TEST (GID, SGID, PID, DATES) values ('1 ', ' 1002', "COE", to_timestamp (12.00.00.000000000 AM Aug 24, 13 ',' DD-MON-RR HH.MI.)) SS. AM FF '));
    7. Insert into TEST (GID, SGID, PID, DATES) values ('2 ', ' 1004', "EDF", to_timestamp (05.22.20.000000000 PM Aug 23, 13 ',' DD-MON-RR HH.MI.)) SS. AM FF '));
    8. Insert into TEST (GID, SGID, PID, DATES) values ('2 ', ' 1003', "FEG", to_timestamp (12.00.00.000000000 AM Aug 24, 13 ',' DD-MON-RR HH.MI.)) SS. AM FF '));
    9. Insert into TEST (GID, SGID, PID, DATES) values ('2 ', ' 1001', 'GHI', to_timestamp (12.00.00.000000000 AM Aug 24, 13 ',' DD-MON-RR HH.MI.)) SS. AM FF '));
    10. Insert into TEST (GID, SGID, PID, DATES) values ('2 ', ' 1006', 'JKL', to_timestamp (12.00.00.000000000 AM Aug 24, 13 ',' DD-MON-RR HH.MI.)) SS. AM FF '));
    11. Insert into TEST (GID, SGID, PID, DATES) values ('3 ', ' 1007', "LMN", to_timestamp (12.00.00.000000000 AM Aug 24, 13 ',' DD-MON-RR HH.MI.)) SS. AM FF '));
    12. Insert into TEST (GID, SGID, PID, DATES) values ('3 ', ' 1001', "Professions", to_timestamp (12.00.00.000000000 AM Aug 24, 13 ',' DD-MON-RR HH.MI.)) SS. AM FF '));

    Hello

    I need a sql query which gives me the time taken to load the records ie., Max date less date min. I ran a query that gives me the result "0 23:59:26.491" below.

    1. Select (max (DATES) - min (DATES)) of the test;

    When I apply the same logic in Peoplesoft enterprise manager, it generates the sub query and throw me the "ORA-01722: invalid number" error.

    1. Select max (TO_CHAR (cast ((DATES) as timestamp),'YYYY-MM-DD - HH24.MI.)) SS. FF'))
    2. -min (to_char (Cast ((dates) as timestamp),'YYYY-MM-DD - HH24.MI.)) SS. FF'))
    3. of the test;

    Can you please modify the above query?

    1. SELECT max (cast (DATE) as date)-mIN (cast (DATE) as date) test;
  • How to get min date each month for six months?

    Hi, I have data like this.

    Process_date SEQ_No
    ------------- ---------
    16 MARCH 13 733
    9 MARCH 13 732
    MARCH 2, 13 731
    24 FEBRUARY 13 730
    16 FEBRUARY 13 728
    9 FEBRUARY 13 727
    2 FEBRUARY 13 726
    26 JANUARY 13 725
    21 JANUARY 13 724
    JANUARY 12, 13 723
    5 JANUARY 13 722
    29 DECEMBER 12 721
    24 DECEMBER 12 720
    15 DECEMBER 12 719
    DECEMBER 8, 12 718
    3 DECEMBER 12 717
    22 NOVEMBER 12 716
    NOVEMBER 17, 12 715
    10 NOVEMBER 12 714
    NOVEMBER 3, 12 713
    29 OCTOBER 12 712
    23 OCTOBER 12 711
    13 OCTOBER 12 710
    OCTOBER 5, 12 709
    28 SEP-12 708
    22 SEP-12 707
    15 SEP-12 706
    08 SEP-12 705
    01 SEP-12 704



    everymonth admin will refresh the data table and automatically this table above is updated with unique seq_no and process_date.

    I need extarct min date of everymonth (first 6 months discount - excluding the months perceive) and also the seq_no associated to this month so using joins (using the seq_no - which is available in the main table) I can combine the actual data.

    I need result like:

    March 2, 13 731 (I don't need MAR such that it take no data for the current month)

    so I need final result as below:

    2 FEBRUARY 13 726
    5 JANUARY 13 722
    DECEMBER 8, 12 718
    NOVEMBER 3, 12 713
    OCTOBER 5, 12 709
    01 SEP-12 704
    select
     min(Process_date) Process_date
    ,min(SEQ_No) SEQ_No
    -- assuming that se_no increases consecutive with the date, otherwise
    -- min(seq_no) keep(dense_rank first order by process_date) seq_no
    from your_table
    where
    process_date < trunc(sysdate,'MM')
    -- if there is data older than 6 months in your table, which is unclear
    -- from your description and the data
    --and
    --process_date >= add_months(trunc(sysdate,'MM'), -6)
    group by trunc(process_date,'MM')
    order by process_date desc
    

    Published by: chris227 on 25.03.2013 03:00

    Published by: chris227 on 25.03.2013 03:03

  • Min Date with 12 hour format

    Dear friends,

    I'm working on a query... I have the date field... I want my date field date min show but also it must show in am / pm format.

    now when I am using the following query shows the date min perfectly, but it shows the date in 24-hour format because I use 24-hour format.

    (select min (to_char (date, "MM/DD/RRRR HH24 double:MI:SS')).))

    but when I apply 12 hours in shape its been not indicating the date of min

    (select min (to_char(date,'MM/DD/RRRR HH24:MI:SS am ')) of the double.

    Help, please... and kindly let me know the reason for this

    You do not MIN date, you MIN of the chain.
    Put the MIN inside your TO_CHAR:

    to_char(min(date),'MM/DD/RRRR HH:MI:SS am ')
    

    In general: almost always is the outermost TO_CHAR function called, so that the inside work all work on dates, and then the to_char is just to format the result as a string.

  • The module page should include the date at which each add-on has been more recently updated to help diagnose problems.

    Sorry, this isn't a question, but a suggestion. If a conflict exists between the modules, it would be useful to know that it has been updated recently. I often keep track of myself, but it would be easier to have this information on the page Add on.

    "Last update" is available from the display of the modules for each module by clicking on the "More" link... "just below the name of the add-on. Scroll down on this new view of the page.

    An add-on that lists information about all Extensions or Plugins, including the date of update (last updated date shows in the options for the Extension List Dumper as "Date of installation")

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

    Not related to your question, but...

    You may need to update some plug-ins. Check your plug-ins and update if necessary:

  • How to export my history of travel (including the date and time) to a text file?

    I need to collect data on the amount of time I spend on specific sites, research on my thesis topic. In my browsing history data. I need a way to export the data from the history file including the date and time information in a format that is easy to parse (.txt file delimited by commas, etc.)

    You are welcome

  • "include vector data" greyed out when recording in EPS

    I work in CS5 with Win7.


    I have a Photoship file with a dynamic object vector, created originally in Illustrator. I lost the Illustrator file and hope there's a way to get the image of Photoship and Illustrator vector. EPS format and including vector data record seemed a logical way to go, but he doesn't seem to let me do. I am trying the impossible? Is there another magic method, that I could try?

    Thank you.

    ~ Valerie

    EPS format and including vector data record seemed a logical way to go, but he doesn't seem to let me do.

    The vector Smart Objects are represented as pixel data in the file, so there is no saving in eps vector data.

    But as MTSTUNER pointed out one can open the SO in Illustrator or we could use the layer > Smart Objects > export content.

  • Need help to try to "include vector data" when you save an EPS? Anyone?

    Although I've done several times before, I just can't understand why the checkbox "include vector data" is grayed out.  I work in CMYK mode - I placed my business as a smart object as usual - logo and none of my layers have applied effects.  Scratching my head right now.  It is a format large poster so I will certainly need to fix this somehow.  Any guidance would be greatly appreciated.

    You must have a layer with a vector mask applied to the function is displayed.

  • How to change step.result.status

    Hello

    I know just how I can configure the result step to something else state that "passed" or "failed". I know that I've done it before, but now I can't get this to work.

    Simple sequence attached file to demonstrate what I'm trying. Report as text in my machine looks like this:

    Start the sequence: MainSequence
    (Text of C:\Temp\status change test.seq)

    Pass/fail test: skipped
    Pass/fail test: failed
    TEST
    Test digital limit: failure
    Measurement: 0
    Limits:
    Low:                   9
    High: 11
    Comparison type: FROZEN (> =)<>

    Complete the sequence: MainSequence

    No reference to what we are missing?

    BR

    Petri

    Petri,

    http://zone.NI.com/reference/en-XX/help/370052K-01/tsfundamentals/infotopics/step_execution/ contains a list of action a step performs when it is executed.

    As you can see, State Expression is evaluated after the Expression. Therefore, you can not use after Expression to set the Step.Result.Status property.

    The following two options, you can try to change the status of the step:

    Option 1:

    Create the custom step type and modify state Expression.

    Option 2:

    You can use the reminder of step motor after updating the result of step

    Option 3:

    Stage results will be added to the Locals.ResultList table. Therefore, after a stage performance, you can change the result container in the table if necessary.

    -Shashidhar

  • Windows 7 will not detect THE routers wireless, including mine.

    Windows 7 will not detect THE routers wireless, including mine. I inserted the cd of restoration of the system, and after that he picked up no internet. No, even if I connect it with the wire! Help!

    Hello

    Thank you for contacting Microsoft Community.
    Is properly installed wireless adapter driver?
    Go to start-> type devmgmt.msc-> press on enter. In the Device Manager window, expand network adapters. You should be able to see a list of network adapter as Ethernet, Bluetooth, etc. Make sure that you can find the adapter wireless from the list. If so, double-click it. Properties windows will be open. On the general tab, under device status, if it shows that the device is not functioning properly, please remove the case, locate the wireless network card and make sure the connections of antennas are coneected correctly. If even a connection is not properly connected or damaged, you cannot connect to any WiFi network.
    Response if the issue is not resolved.
  • Get registration using min date

    Oracle 10g

    Hi gurus

    I get a few problem of performance and grateful if someone help out me. I have the table sample as below:

    Examples of data

    WITH AS A REFERENCE

    (

    SELECT 1000 case_id, 1 c_point, to_date('01-jan-2015') crt_dt, to_date('01-feb-2015') next_crt_dt, 4 next_c_point OF DOUBLE UNION ALL

    SELECT 1000 case_id, 1 c_point, to_date('01-jan-2015') crt_dt, to_date('01-mar-2015') next_crt_dt, 5 next_c_point OF DOUBLE UNION ALL

    SELECT 1000 case_id, 1 c_point, to_date('01-jan-2015') crt_dt, to_date('01-apr-2015') next_crt_dt, 5 next_c_point OF DOUBLE UNION ALL

    SELECT 1000 case_id, 1 c_point, to_date('01-jan-2015') crt_dt, to_date('01-jun-2015') next_crt_dt, 7 next_c_point FROM DUAL

    )

    Select distinct d.case_id, c_point, crt_dt

    ,

    (

    Select min (next_crt_dt)

    reference (Datum) dd

    where dd.case_id = d.case_id

    )

    min_dt

    ,

    (by selecting next_c_point in DATUM dd

    where dd.case_id = d.case_id

    and NEXT_CRT_DT = (select min (next_crt_dt) DATUM dd

    where dd.case_id = d.case_id

    )

    ) next_c_point_final

    reference d;

    The query result

    CASE_ID, C_POINT, CRT_DT, MIN_DT, NEXT_C_POINT_FINAL

    1000 1 1 JANUARY 15 1ST FEBRUARY 15 4

    Query is showing good result but I am wondering it is any other way to do the same thing instead of get requests additional data, see data in red text...

    Concerning

    MIT

    Hi Mitchels,

    Here is the implementation of the function table that mask the query and is able to pass to the query parameters.

    create or replace
    type datum_object force is object (
      case_id number,
      c_point number,
      crt_dt date,
      min_dt date,
      next_c_point_final number
    );
    /
    create or replace
    type datum_table is table of datum_object;
    /
    
    create or replace
    function datum_report(p_hearing_dt date)
    return datum_table pipelined
    is
    begin
      for r in (
        select
          datum_object(
            1000,
            1,
            p_hearing_dt,
            date '2015-02-01',
            4
          ) as datum_object
        from dual
      )
      loop
        pipe row(r.datum_object);
      end loop;
    end;
    /
    -- test
    set linesize 130
    alter session set nls_language=american nls_territory=america
    ;
    select distinct
      case_id,
      c_point,
      crt_dt,
      min_dt,
      next_c_point_final
    from table(datum_report(date '2015-01-01'))
    ;
    drop function datum_report
    ;
    
    Type DATUM_OBJECT compiled
    Type DATUM_TABLE compiled
    Function DATUM_REPORT compiled
    Session altered.
    
       CASE_ID    C_POINT CRT_DT    MIN_DT                         NEXT_C_POINT_FINAL
    ---------- ---------- --------- --------- ---------------------------------------
          1000          1 01-JAN-15 01-FEB-15                                       4
    
    Function DATUM_REPORT dropped.
    
  • Windows 7 Autoplay import filename Options settings includes not "date taken" and tag

    One of the options for formats of filename with pre-Win7 was 'date taken + tag. It seems that this option is no longer available. Date-taking can be specified for the names of folders, but not names. Also, I thought there are two import - Windows and Windows Live Photo Gallery programs. With Win7 I see only using the import window.

    I photograph all summer a group of sailing and import the photos every day with the same tag (butterflies, Crappie-Sun). At the end of the season, I create a collection of all these photos and if file names are duplicated, they certainly if file names are 'tag' only, I have problems...

    Hi NoDakBoy,

    You can change the settings Windows uses when importing photos and videos from cameras, portable devices, scanners, or data CDs or DVDs. These import settings to determine how the images and videos are named and organized when import you them to your computer.
     
    For more information, see:
     
    Change the settings for importing pictures and videos
    http://Windows.Microsoft.com/en-us/Windows7/change-settings-for-importing-pictures-and-videos
     
    Aziz Nadeem - Microsoft Support

  • The Miner data flow planning

    Hello

    Please prdovide the steps to plan the workflows in the oracle data miner using sqldeveloper.

    Thank you

    HS

    Hi Mark,

    Thanks for the Nice info.

    Please write how to create the "chain of workflow step that runs the workflow generated script files" as a workaround.

    Would appreciate your help because the workflow must be scheduled to run automatically.

    Then is it possible to import the residual plot so that it could be displayed even without using the ODMr as a customer.

    Once more I appreciate your help.

    Thank you

    POOJA

  • Type of data resulting from the difference between two timestamps

    Hi, I have a simple question.
    I have two TIMESTAMP A and B variables. Now I want to subtract one B - A. What type of data as a result of this subtraction?
    Would Shouln t TIMESTAMP again?

    Consider this example:
    DECLARE
       vdat_Begin        TIMESTAMP;
       vdat_End          TIMESTAMP;
       vdat_Difference   TIMESTAMP;
    BEGIN
       vdat_Difference := vdat_End - vdat_Begin;   -- this doesn't work
       vdat_Difference := TO_TIMESTAMP(vdat_End - vdat_Begin);   -- this works
    END;
    /
    
    PLS-00382: expression is of wrong type
    Thanks for help.

    xxsawer wrote:
    Hi, I have a simple question.
    I have two TIMESTAMP A and B variables. Now I want to subtract one B - A. What type of data as a result of this subtraction?
    Would Shouln t TIMESTAMP again?

    Consider this example:

    DECLARE
    vdat_Begin        TIMESTAMP;
    vdat_End          TIMESTAMP;
    vdat_Difference   TIMESTAMP;
    BEGIN
    vdat_Difference := vdat_End - vdat_Begin;   -- this doesn't work
    vdat_Difference := TO_TIMESTAMP(vdat_End - vdat_Begin);   -- this works
    END;
    /
    
    PLS-00382: expression is of wrong type
    

    Thanks for help.

    No, as stated, there will be an interval.

Maybe you are looking for