cannot get max date


Hello! I have what should be a very simple script that drives me up a wall and could use some help:

Select employee, status,

Max (beg_date) Begin_Date

of lawsonprd.hrhistory

where fld_nbr = '20' and (beg_date > = 1 February 13 ' and beg_date < 1 July 13 ')

Group of official, status

I get the date maximum start for EACH situation, the employee was, but I want just the maximum start date and status attached to it.

Thank you

Chris

Suggestions:

(1) specify all 4 digits of a date - ALWAYS.

(2) specify the date format when you convert dates, or strings to date - ALWAYS.

These 2 tips will save you hours of headache... someday.

Try this query:

with w_max_date as

(select employee, beg_date, fld_nbr, status,)

ROW_NUMBER() over (partition by employee

beg_date desc order) max_beg_date

of lawsonprd.hrhistory

where fld_nbr = 20

and beg_date > = to_date (February 1, 2013 ',' mon-dd-yyyy "")

and beg_date<  to_date('01-jul-2013',="">

)

Select the employee status, fld_nbr, beg_date,

of w_max_date

where max_beg_date = 1

/

Tags: Database

Similar Questions

  • Cannot get the date system. My input format is %d %m %Y and the output is also a format "YYYYMMDD"?

    Hi all

    I'm using Labview 8.5.

    I'm trying to get the date system.

    I use the Format Date/time string in a "%Y %m %d' format.

    The PROBLEM is the Format Date/time string return "YYYYMMDD" only.

    Please see my attachment to see.

    Please help me with this, whenever I encounter this problem it force to reinstall labview program.

    Best thanks!


  • Is there a way to get a picture received in e-mail the date was taken originally? I cannot get the date it was sent to show.

    I have two photos that were sent to me & I need to determine the date, what they were originally taken.  One or both may have come out of a social networking site.  When I click on the info button, I get only the date, that the pictures were sent by e-mail to display.

    If you right on the file and choose... Properties Summary / tab.
    Test tip... you can see the date if it is available.

  • When I pull the select query, but therefore cannot get the data that you check?

    Hello

    When I raised this query without get data then can you help me it's ok?

    DataSource {
                            id: durgSearch_dataSource
                            source: "sql/durg.db"
                            query: "select * from durg_detail where durg_name =" + "\"" + searchTextField.text + "\""
                            onDataLoaded: {
                                durgSearch_dataModel.insertList(data);
                            }
                        }
    

    Glance. I just tested your app and it works correctly. I entered Rock and search button and it returns a Rock record. If you want to get all records that contain a particular letter or Word, you can use the following query:

    "select * from medicin_detail where PharmacyName LIKE '%" + searchTextField.text + "%'"
    
  • He had to get Max date

    Version of Oracle, Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production

    Hi gurus

    Once again I need your help. I have the following data.

    Examples of data

    As with a REFERENCE

    (

    Select 'Health' BILL_TYPE, TO_DATE('12May2014','ddMonyyyy') BILL_DT of the DOUBLE

    Union of all the

    Select 'Health' BILL_TYPE, TO_DATE('14May2014','ddMonyyyy') BILL_DT of the DOUBLE

    Union of all the

    Select 'Health' BILL_TYPE, TO_DATE('15May2014','ddMonyyyy') BILL_DT of the DOUBLE

    Union of all the

    Select 'No health' BILL_TYPE, TO_DATE('12May2014','ddMonyyyy') BILL_DT of the DOUBLE

    Union of all the

    Select 'No health' BILL_TYPE, TO_DATE('14May2014','ddMonyyyy') BILL_DT of the DOUBLE

    Union of all the

    Select 'No health' BILL_TYPE, BILL_DT null from DUAL

    )

    Select * reference

    ;

    The query result

    BILL_TYPE BILL_Dt

    HealthMAY 12, 14
    Health14 MAY 14
    Health15 MAY 14
    Not healthMAY 12, 14
    Not health14 MAY 14
    Not health


    Now what I need, is that I need to max bill date based on Bill Type, but if there is no NULL value that BILL Type then return Null, for example, in the case of type health bill, I need bill_dt max is 15-MAY, in the case of Type no health bill, I need max bill_dt = Null because one of the value is Null.

    Desired result

    Bill Type Max (Bill_dt)

    Health may 15, 14

    Health non-Null

    Help, please


    As with a REFERENCE

    (

    Select 'Health' BILL_TYPE, TO_DATE('12May2014','ddMonyyyy') BILL_DT of the DOUBLE

    Union of all the

    Select 'Health' BILL_TYPE, TO_DATE('14May2014','ddMonyyyy') BILL_DT of the DOUBLE

    Union of all the

    Select 'Health' BILL_TYPE, TO_DATE('15May2014','ddMonyyyy') BILL_DT of the DOUBLE

    Union of all the

    Select 'No health' BILL_TYPE, TO_DATE('12May2014','ddMonyyyy') BILL_DT of the DOUBLE

    Union of all the

    Select 'No health' BILL_TYPE, TO_DATE('14May2014','ddMonyyyy') BILL_DT of the DOUBLE

    Union of all the

    Select 'No health' BILL_TYPE, BILL_DT null from DUAL

    )

    Select bill_type, max Dungeon (bill_dt) (dense_rank first order by bill_dt desc nulls first)

    reference by bill_type group.

  • Cannot get rid of the BIOS password

    Bought an ACER Aspire E1 from an EBAY of ACER store about a year ago. A few weeks ago, I started it and quickly received a BIOS PASSWORD entry. Since that time, the laptop was absolutely worthless. I guess I tried the hardware, software, battery and all I could think of to fix the problem. I tried the MICROSOFT forums. ACER, ASK.COM Forums and forums Forums, forums, forrums and other forums that I could think of to try to resolve the unknown BIOS password. Thanks UEFI.

    I guess short of replacement of the EEPROM on the motherboard (don't think even that would help) which I'd be suspicious to do.

    Cannot get rid of the BIOS password.

    If I contact the ACER Support, they say that it's a hardware problem. I tried (as suggested by ACER support), bringing to STAPLES, BESTBUY, FRYS ELECTRONICS, OFFICE MAX, DATA DOCTORS, and several other 'Repair computer facilities' nothing works.

    IN a WORD, it's a PIECE OF a $400 trash...

    If anyone has any ideas on how to reslove this issue, send me an E-mail, fax, text. or post a reply...

    Thanks for letting me the WIND...

    WMARSH...

    can you post the exact model E1?

    E1 - xxx

  • Lost user account password and cannot get into Netbook

    We bought a Toshiba Netbook nb200 for our teenager for Christmas.

    She was so excited to get it and was on the computer immediately implemented its own user account without writing or allowing me the time to create a floppy disk for it.

    Now the user account won't let us. She said she knew what was the password and when we try, it doesn't work. We spent two days by typing everything under the Sun to see if we can get it and no luck.

    2 days after that Christmas and she cannot get into the computer at all.

    I tried SafeMode etc and does not work.

    Any suggestions on what it takes to please?

    Thank you.

    Try this...

    To retrieve the original factory image using the utilities on your computera? s internal disk storage:

    1. make sure that the computer is turned off.

    2. press in and hold the value 0 (zero) key on your keyboard all turn on/off the computer.

    3. If your system offers a choice of Windows® 7 32-bit or 64-bit operating system, you can select one right now. If this is not the case, go to step 4.

    4. a warning screen opens, indicating that when the recovery is performed all data will be deleted and rewritten.

    Click Yes to continue. Follow the instructions to do a full restore...

    HTH,

    The f

  • print module cannot get the printer device context

    I can't get my printer to work. It seems that the computer does not recognize the printer when I plug. No printer symbol. then, when I try to print a square stands up and says 'printing module cannot get printer device context' I have no idea what this means or what to do about this please help

    You need to get the print vendor drivers.   You can try using a printer driver that converts data of the PDL even that interprets your device, but you should request this information from the company that made the device

    Alan Morris Windows printing team; Here Microsoft Knowledge Base search: http://support.microsoft.com/search/Default.aspx?adv=1

  • error barsigner: cannot create application data directory

    Hello, I got this error when I try to sing my application:

    error barsigner: cannot create application data directory

    I tried everything: as an administrator, change the directory security and so on.

    I get this error with the command line and from Flash Builder.

    I have v.0.9.1 SDK

    I have my application ready to be submitted, but cannot understand this error, I would be very disappointed to not meet the deadline of March 31 :-/

    Any clue? Thank you

    Really 0.9.1? could sign you your application with this version? have you tried the SDK 0.9.4?

  • VDP: Cannot access the data store

    Hello!

    I have a problem.

    Every day I see error for one of my servers in "reports":

    2016-07 - 05T 06: 00:47.971 + error 06:00-[7F2F3FA5E700] [Originator@6876 = transport sub]

    Cannot use hotadd mode to access the FileSrv1/FileSrv1_1.vmdk [Cisco2-datastore]: can't get using this method.

    (Mounting VM using vm-3198 transport hotadd failed: cannot access the data store for one of the drives of the Machine virtual FileSrv1..)

    At the same time, I havn't this error for the other servers.

    "FileSrv1" has not has installed "VMWare tools". After the instalation "VMWare tools" on this server, the problem is resolved.

  • Cannot access another data base "ROWTYPE.

    Hi all, I am using SQLDeveloper 3.2.20 on Oracle 11 g 2 and teacher of Windows 7 sp1 and so far, smooth sailing.

    I use the SCOTT/tiger account i.e. access, certainly no role sysdba privileges.

    I'm practicing my codes and the use of explicit cursors generate following errors:

    Error report:

    ORA-06550: line 5, column 17:

    PLS-00352: cannot access another data base "ROWTYPE.

    ORA-06550: line 5, column 17:

    PLS-00201: identifier 'EMP_CURSOR@ROWTYPE' must be declared.

    This is the code (I tried orcl.scott.emp_cursor@ROWTYPE, but which no longer works)

    Set serveroutput on;

    DECLARE

    CURSOR emp_cursor IS

    SELECT EmpNo, ename

    FROM scott.emp;

    v_emp_record emp_cursor@ROWTYPE;  -don't even try the 1 by 1

    number of v_sqlcode;

    v_errm varchar2 (64);

    BEGIN

    IF NOT emp_cursor % ISOPEN THEN - EXTRACTION lines only when the cursor is opened!

    OPEN emp_cursor;

    END IF;

    LOOP

    LOOK INTO v_emp_record emp_cursor; -Gets the 1st row of cursor!

    OUTPUT WHEN emp_cursor % NOTFOUND or emp_cursor % NOTFOUND IS NULL; -in case no line

    INSERT INTO (empid, empname) tmp_list - inserts in a temporary list

    VALUES (v_emp_record.empno, v_emp_record.ename);

    END LOOP;

    COMMIT;

    NARROW Emp_cursor;

    EXCEPTION

    while others then

    v_sqlcode: = SQLCODE;

    v_errm: = SUBSTR (SQLERRM, 1, 64);

    DBMS_OUTPUT. Put_line ('SQL' | v_sqlcode |) '  ' || v_errm);

    END;

    /

    I begin to suspect that it is something 'access privilege '.

    Can someone point me in the right direction please?

    Hello

    Leila says:

    Ahhh, I see where I went wrong, Oracle' a global temporary table is not the same as the temporary table in SQLServer, I first need to create the temporary table, then drop it then.

    Remove the table only if you expect never to use again.  Otherwise, let it stay there.

    "Global temporary table" is a misleading name in Oracle.  The table itself is permanent, but the data in the table are temporary.  The data is deleted automatically at the end of the transaction or session, depending on whether the table has been created with ON COMMIT DELETE ROWS or ON COMMIT PRESERVE ROWS.

    Problem is, there is no data in the temporary table after executing the PL/SQL block although DBMS_OUTPUT displays data from test loading one!

    The default value for global temporary Tables is ON COMMIT DELETE ROWS, which means that the table is cleared whenever you make a COMMIT to auotmatically.

    You probably want ON COMMIT PRESERVE ROWS, like this:

    CREATE a table temporary global tmp_list (NUMBER, tmp_empno tmp_ename. VARCHAR2 (10)) ON the COMMIT PRESERVE ROWS;

  • Error "cannot send print data.

    Hi gentlemen,

    As I put to update my sistem for snowleopard mac 10.6.3 I can't print and scanning, the work starts and then gets a break with the "Cannot send print data" message.
    Troubleshooting: already uninstalled all HP applications (now the key ctrl, opt, cmd), reinstall, is is set to software update, remove printer and added still, nothing worked.

    Am going to the apple store, they said that you have a 'fixing package?' who could help...

    Any suggestions?

    Problem solved performing once all of the above sequences...

  • Is it possible to see/get the data from the table to a dump file

    I have files dmp generated using expdp on oracle 11 g...

    expdp_schemas_18MAY2013_1.dmp

    expdp_schemas_18MAY2013_2.dmp

    expdp_schemas_18MAY2013_3.dmp

    Can I use a settings file given below to get the data from the table in the file sql or impdp the only option to load the data of table in database.

    VI test1.par

    USERID = "/ as sysdba".

    DIRECTORY = DATA

    dumpfile=expdp_schemas_18MAY2013%S.dmp

    SCHEMAS = USER1, USER2

    LOGFILE = user_dump_data.log

    SQLFILE = user_dump_data. SQL

    and impdp parfile = test1.par.

    No,

    DataPump cannot retrieve a dumpfile data in a flat file.

    Dean

  • output of Get-store data in the table (datagrid)

    Hello

    I'm trying to get the output of get-store data in a table (datagrid).

    Code:

    Function Get-data warehouses
    {
    $array = new System.Collections.ArrayList object
    $Script: GetDatastore = Get-Datastore
    $array. AddRange ($GetDatastore)
    $dataGrid1.DataSource = $array
    $form1.refresh)
    }

    error:

    Das Argument '0' mit dem Wert "local_datastore01" as "AddRange' nicht den Typ"System.Collections.ICollection"konvertiert werden kann:" Der Wert "local_datastore01" vom Typ VMware.VimAutomation.Cl «»»
    ient20. DatastoreImpl' nicht den Typ "System.Collections.ICollection" konvertiert werden kann. »
    -snip-
    + $array. AddRange < < < < ($GetDatastore)
    + CategoryInfo: NotSpecified: (:)) [], MethodException)
    + FullyQualifiedErrorId: MethodArgumentConversionInvalidCastArgument

    Comment:

    If I replace the query data get store-get - VM the script works great!

    What's wrong? any suggestions?

    Many thanks and greetings

    Hello

    This particular Get-Datastore call returns a single object, which cannot be converted to the ICollection. But you can do something like this:

    If ($GetDatastore-[table]) {}

    $array. AddRange ($GetDatastore)

    } else {}

    $array. Add ($GetDatastore)

    }

    It will manage both situations - when you get the data object store or table of data warehouses.

    Vitali

    Team PowerCLI

  • Download of CSV using Browse point (don't get no data found error)

    Hello

    I use procedure below to download CSV in my table.

    CSV is to have null values in some places ex: 1,.
    2,0.999
    3,
    4,0.696

    below the procedure works fine when I am downloading as CSV: 1.0
    2,0.999
    3.0
    4,0.696.

    My table is seen as two columns, and I get no data found error when downloading a CSV of null values.

    I went through import data in Excel to the database table but no use...

    Please help me on this.

    Procedure
    ===========
    DECLARE
    v_blob_data       BLOB;
    v_blob_len        NUMBER;
    v_position        NUMBER;
    v_raw_chunk       RAW(10000);
    v_char   CHAR(1);
    c_chunk_len  number := 1;
    v_line  VARCHAR2 (32767) := NULL;
    v_data_array  wwv_flow_global.vc_arr2;
    
    BEGIN
    
    -- Read data from wwv_flow_files
    select blob_content into v_blob_data  from wwv_flow_files
     where UPDATED_BY = (select max(UPDATED_BY) from wwv_flow_files where UPDATED_BY = :APP_USER)
    AND id = (select max(id) from wwv_flow_files where updated_by = :APP_USER);
    
    v_blob_len := dbms_lob.getlength(v_blob_data);
    v_position := 1;
     
    -- Read and convert binary to char
    WHILE ( v_position <= v_blob_len ) LOOP
     v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
     v_char :=  chr(hex_to_decimal(rawtohex(v_raw_chunk)));
     v_line := v_line || v_char;
     v_position := v_position + c_chunk_len;
    -- When a whole line is retrieved
     IF v_char = CHR(10) THEN
    -- Convert comma to : to use wwv_flow_utilities
      v_line := substr(v_line, 1, length(v_line)-2);
       v_line := REPLACE (v_line, ',', ':');
    -- Convert each column separated by : into array of data
       v_data_array := wwv_flow_utilities.STRING_to_table (v_line);
    -- Insert data into target table
       EXECUTE IMMEDIATE 'insert into table_name@Schema1 (col1,col2)
        values (:1,:2)'
        USING
          v_data_array(1),
          v_data_array(2);
          
          -- Clear out
       v_line := NULL;
      END IF;
     END LOOP;
    
    END;
    concerning
    Chauvet

    Published by: Chaumont on 26 September 2012 10:52

    Published by: Chaumont Sep 26, 2012 22:25

    Published by: Chaumont on 27 September 2012 01:58

    Chambers,

    You can use wwv_flow_utilities.array_element to avoid any no_data_found. The function does not raise any errors. For example, for the line which only have a value of table when you wait 2, it can be useful.

    EXECUTE IMMEDIATE 'insert into table_name@Schema1 (col1,col2)
        values (:1,:2)'
        USING
          wwv_flow_utilities.array_element(v_data_array,1),
          wwv_flow_utilities.array_element(v_data_array,2);
    

    Kind regards
    Christina

Maybe you are looking for

  • Qosmio G20 - how to install with a single drive HARD and without RAID?

    I would like to implement G20 Qosimo new with Windows XP 32.I bought a new hard drive and put it on the slot 1. I would like to run without any RAID (slot 2 is so empty) XP installation CD not found HDI went into the BIOS to see if the HD was there -

  • unknown error 4000 during the ios update

    iTunes says to connect my iPhone 6 to update its software. Request you a code digit. I do that and it downloads and extracts of software. Then I get a message that says: On the iPhone 6 settings it says my version is 9.2.1 (13D 15). Someone can such

  • HP Envy 5540: Printer Hp Envy 5540 randomly printed the Network Configuration Page

    Hello! I bought this printer about a month ago. Set up the connection to the printer wireless with my wifi, and my understanding is that the printer is protected like my wifi and use the same password in order to print something. I kept my printer co

  • EA6900 Super slow flow

    I have an EA6900 put in place for the routing functions on a Virgin Media 120Mbps cable connection.  I see a very slow flow on the Linksys router, and after looking for obvious causes, I am stumpted. The EA6900 is connected to Virgin Media "Superhub"

  • How to disable print auto fax

    How can I turn off auto fax on my photosmart printing 6520.  Thank you.