How to display/retrieve related row data on a maximum date formula

Here's data for one employee:
Charge Date   Work Date   Segment
11/05/08         11/28/08       TPLNDD
11/07/08         11/09/08       TPLNDN
11/21/08         11/22/08       TPLNDA
11/26/08         11/29/08       TPLNDN
12/11/08         12/14/08       TPLNDN
I want to calculate the maximum "charge date" where segments in "TPLNDD", "TPLNDA".  Then, once this date is selected (11/21/08), I want to pick/retrieve the date which corresponds to that record (11/22/08).
I would like to avoid creating a group for the maximum charge date, because I want to be able to drill down to the details and see all the records.
Thanks, Ada

Here you go..
Select emp_id, charge_date, Work_date, Segment from Employee_table e
where segment in ('TPLNDD', 'TPLNDA')
and charge_date = (select max(charge_date) from Employee_table where segment in ('TPLNDD', 'TPLNDA') and emp_id = e.emp_id)
Assuming you have the emp_id which is the primary key.
Thanks
-Azhar

Similar Messages

  • How to display retrieved data from DB on web page

    Dear all,
    how to display retrieved data from oracle database on web page,Does anyone can give me an simple example?
    thanks
    WJ

    Hi,
    I use JRun tags but you can use Oracle tags or just JDBC... First u need to install jdbs connection and set e connection by using JMC (For JRun) named nomad.
    U can also try the link below for JRun tags..
    http://wds.its.uiowa.edu/cache/docs/jrun/html/JRun_Custom_Tag_Library/contents.htm
    <%@ page import="java.sql.*,javax.sql.*,java.text.*,allaire.taglib.*" %>
    <%@ taglib uri="jruntags" prefix="jrun" %>
    <%@ page contentType="text/html; charset=ISO-8859-9" %>
    <html>
    <head>
    <title> Test Page </title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
    </head>
    <body>
    <BODY BGCOLOR="#FFFFFF" LEFTMARGIN=15 TOPMARGIN=20 >
    <jrun:sql datasrc="nomad" id="q1">
    select empno,
         ename
    from emp
    order by ename
    </jrun:sql>
    <center>
    <table border = 0 cellpadding = 3 cellspacing = 1>
         <th>EmployeeNo</th><th>Name</th>
    <jrun:param id="q1" type="QueryTable"/>
    <jrun:foreach group="<%= q1 %>">
                   <tr>
                   <td> <%= q1.get(1) %> </td>
                   <td> <%= q1.get(2) %> </td>
                   </tr>
    </jrun:foreach>
    </table>
    </center>
    </body>
    </html>
    ----------------------

  • The logic board on my MacBook Pro has failed. How do I retrieve all my data from the hard drive?

    The logic board on my MacBook Pro has failed. How do I retrieve all my data from the hard drive?

    Remove the drive and put it in an external enclosure. Backup the drive completely. Repartition and format the drive. Replace the drive into the computer. Take the computer in for the logicboard replacement.

  • How to display number of rows as columns in a select statement? This is on

    How to display number of rows as columns in a select statement? This is on 10g R2.
    Thanks,
    R

    For the current (ie. row 1 of 100)
    row_number over (order by -pick_a_column_set) as rnfor the total number of columns returned in your query
    count(*) over() as total_count

  • How to display success message when data is changed in the custom tab in MM

    Hi,
    I have added a new custom data tab in the MM01/MM02/MM03 transactions. Whenever I do changes to fields in the custom tab in MM02 transaction, and no changes in the standard tabs, I will get a message stating "No Changes Made".
    But if I do changes in the standard tabs, it works as usual with display of message "Changes to particular material has been done.
    Please let me know, if anyone of you know, how to display the success message if the changes to the custom tab is done.
    Thanks in advance,
    sudhanva

    Hi Sudhanva,
    The exit EXIT_SAPLMGMU_0001 is a function exit that you can use for custom validation but not to add custom tab/screen.
    But the message issued by SAP is not related to this Function Exit.
    If you have used a Screen Exit, then there must be some Function Exits also in the same Enhancement using which you can assign the value of custom fields to/from the standard structure. Thus when the value of any custom field is changed the system can understand that the some changes have been changed and will  not issue the message.
    In case you have used a BADI, there can be other methods in the BADi using whcih you can assign the value of custom fields to/from the standard structure. This might also prevent the message from being displayed.
    I could try giving you further details if you can provide the name of the Enhancement/BADi that you used to add the additional tab.
    Hope this helps.
    Regards,
    Abhisek.

  • How can we retrieve all rows following a particular records in a table.

    Hi all,
    i've to fetch all records following a particular rcord in a table..
    for ex. we have 4 rows :
    col1 col2 col3
    A A1 A2
    B B1 B2
    C C1 C2
    D D1 D2
    How can i retrieve rows following B record. plz. help me
    Thx.

    It depends what you mean by "following". Tables don't have an innate ordering. If you selected all the rows from this table they wouldn't necessarily turn up in that order.
    All you can do is create a query ordering by one or more of the columns (in this case you appear to want lexical order) and then select on the basis that the column values exceed a set of values.
    For example, with your data this happens to work:
    select * from yourtable where col1 > 'B' order by co1;But I very much doubt that this is what you actually need to do, and it is VERY important that you grasp that tables do not have any innate ordering.

  • Urgent please: lost all datas while sync my new iPhone. how can i retrieve my old datas? through icloud?

    urgent please: I have a new iphone 4S and while sync with itunes, it was not done using the data of my old iphone but with a new virgin iphone. how can I retrieve and sync with my old datas? through icloud? or have I lost everything? please help

    to be more precise
    I have saved all my datas of my old iphone on itunes and icloud. I got a new phone 4s that I connected to itunes in order to load it and sync with my old datas. but I don't konw how but when itunes sync my new iphone i did not take my old datas. at the end of the sync process, I got an iphone totally virgin, but none of my previous apps, neither contact neither calendar neither anything. what happened? did itunes erased all my previous datas?? i hope not but if it's the case, can I recuperate my old datas through icloud? please help because as a lot of us, all my life is in this iphone.. (contacts, photos of my 18months girl, etc etc)
    thank you very much

  • How to display metadata such as data load date in answers report title?

    We have a requirement to display the last load date of the data relevant to the report the user is viewing. We have such information stored in a metadata table listed by the fact table the report is referencing. Our proposed solution is to create new answers reports off of this metadata table and put each report (with the appropriate filter on the fact table) on each dashboard section where the corresponding report is placed. One problem with this approach is the load date information will not be reflected in the print form of the report as the date is dashboard content - not report content. Is there any way to overcome this situation (other than create a ton of variables specifically created for this purpose)? I'm open to entertaining javascript ideas, if necessary. I would love to know how to push this OBIEE envelope further. Thanks in advance.

    Hi,
    I discuss with some people who are familiar with SharePoint, we both thought Windows Explorer may
    not accept the custom metadata.
    if we want to do some customization, it is recommended to ask for help in development forum.
    http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/home?category=windowsdesktopdev
    If you have any feedback on our support, please click
    here
    Alex Zhao
    TechNet Community Support

  • How to display multiple selected rows in a table inside a popup?

    Hi,
    I have a table on which multiple selection is enabled. I am able to get hold of multiple selected rows i.e. i am able to iterate over the selected row keys and print their values. Now, my problem is how to display the contents of all the selected rows in a popup? I get the details of only one row when I launch the popup.
    Thanks
    Karan

    Hi,
    Not confident if this works or not but just try it...
    1. create a ViewLink between the same view Object.
    The source and destination wil be the same Vo and the source and destination attribute will be the pk of both Vos.
    2. Update the changes in Appln Module.
    Open the AM and in DataModel tab .
    select the Same VO from which you created table in the DataModel Listbox and select the VL in the "Avaible View Objects" List Box. Add under it(selected vo in datamodel listbox).
    3. Refresh DataControl accordion.
    4. in your jsff page drag and drop the child vo as a table..
    See if it works
    Regards,
    Santosh.

  • How to get access to Row Data (Child Text) in a Tree Control Pragmatically?

    In LabVIEW 2010, I have entered Row Data into a Tree Control pragmatically using the Add Item method and providing the Child Text array and the Child Tag for the Row. When a Row in the Tree Control is selected, I can get the Row Tag in the Value Property of the Tree. But how do I access the Child Text array data when the Row is selected? I can't seem to find a Tree Control Property or Method that will return that data back again.
    What I am trying to do is: once a Row in a Tree is selected and a button is pushed, if the Row Tag is valid, I want to transfer all of the Row data into another similarly formatted Tree. To do that I need the Row Data for the Tree and Row that was selected. I can not find a way to get access to this Row Data after it has been entered into the Tree.
    Can anyone tell me how to pragmatically access the Child Text or Row Data in a Tree Control from a selected Row in the Tree? I have the Tag for the Row, but how do I access the data?
    Thanks for your assistance.
    Solved!
    Go to Solution.

    As mentioned in the posting here, you can use the Active Item:Tag property to set the item to which subsequent property changes apply. This includes pulling the Active Celltring values out in a for loop as you increment the Active Cell:Active Column Number to get the row's Child Text data programmatically as I was originally wanting to do.
    Note that wiring a 0 to the ActiveColNum property and reading the String value will return the tree item's visible name (in column 0), but not the unique item Tag (which is somewhat intangible after its creation). Therefore, I save the unique item tag when I add the item to the tree control (the output of the Add Item invoke node) and store it as a separate column of the Child Text array and place it out of sight in the tree control so I have access to it later. It might be useful, it might not.
    I find the tree control totally non-intuitive and not well explained anywhere, but that's how a lot of LabVIEW coding is I guess. Play with it long enough and you become an expert. I had to learn the hard way, but I hope this helps someone else.
    -Richard
    "Computers are useless. They can only give you answers." - Pablo Picasso

  • How to display first 5 rows with a specific filter

    Hi All,
    Please do have a look at the below mentioned query.
    select * from emp where empnm like 'B%';Now suppose it will display 10 rows. But I want to display first 5 rows out of them.
    How can I do that? I tried this with rownum and rowid. It worked because the records are in order,
    but if those records are in arbitrary order, now what? What should be done here?
    Regards,
    BS2012.

    BS2012 wrote:
    Hi All,
    Please do have a look at the below mentioned query.
    select * from emp where empnm like 'B%';Now suppose it will display 10 rows. But I want to display first 5 rows out of them.
    How can I do that? I tried this with rownum and rowid. It worked because the records are in order,
    but if those records are in arbitrary order, now what? What should be done here?
    Regards,
    BS2012.This will display the first 5 records no matter of the order
    select * from emp where empnm like 'B%'
    and rownum <=5;This will display the first 5 records after ordering them
    select * from (select * from emp where empnm like 'B%' order by empnm) where rownum <=5 ;Regards.
    Al
    Edited by: Alberto Faenza on Oct 11, 2012 5:49 PM
    Edited by: Alberto Faenza on Oct 11, 2012 5:50 PM

  • How to find tables related to data sources

    Hi...
    Can anybody tell me how to fine Database tables related to Data source.
    Ex: I have a data source 0fi_ap_3. How can i fine From   which tables it is extracting the data.
    Thanks & Regards
    Pankaj Angra

    Hi Pankaj,
       This has already been discussed in the following forum links,.. they will be helpful...
    Re: Find R/3 tables which are in the datasource
    Tables associated with DataSource!
    Find R/3 tables which are in the datasource
    Hope this helps...
    Thanks,
    Raj

  • How to decide target related to data source

    Hi Friends,
                    How can i decide data target(ODS/CUBE) related to Data Source.

    Hi Vishali,
    It depends on the type of data load and volume of data.
    If it is full upload with small volume of data, you can directly load cube.
    if it is full upload with large volume of data, then you can load a DSO and then load delta to the cube.
    If you have delta load which supplies only the after image, then you have to load that into DSO before loading delta to the cube.
    If your delta load supplies before and after image then you may or may not keep a DSO in between.
    What is your scenario?
    Thanks,
    Krishnan

  • LSMW , how the same is related to data migration,.

    HI Experts,
    please explain the concept of data migration.
    What is LSMW/ how the same is related to migration,
    what are the other types of data migrationo other than IDOC & BDOC in sap crm.
    IS there any there other tools that helps in data migration,
    if so , what are they.
    Can a functional guy be able to do the data migration in LSMW.
    thanks & regards
    Prajith P

    Hi Prajith,
    I second Venkat, but also you need to know about Data Transfer Workbench in CRM.
    Go into the IMG and follow the path: Customer Relationship Management>> CRM
    Middleware and Related Components>> Exchanging Data With External
    Components>> XIF Adapter Setup>> Inbound Direction>> Settings for the Data
    Transfer Workbench and LSMW>> SAP Data Transfer Workbench.
    Here's the help from SAP for the Data Transfer Workbench:
    http://help.sap.com/saphelp_nw70/helpdata/EN/0d/e211c5543e11d1895d0000e829fbbd/frameset.htm
    That should take you where you need to go. Good luck!
    Satish

  • How to display document last modfied date time in core result web part?

    Hi,
    We have a requirment in the sharepoint application where we need to display last modified date&time of document in core result web part.
    To support this we have specify the property <Column Name="Write"/> in custom XSL.
    But it displays only the modified date.Is there is way to display modified date and time as well?
    D.Ganesh

    If you want to modify the
    XML can do i tin the
    template "DisplayTemplate":
    An example:
    Replace
    <xsl:value-of select="write" />
    by
    <xsl:value-of select="ddwrt:FormatDate($write, 1033, 2)"/>
    But I think the managed property"Write"
    is returned only as
    Date without
    Time. By
    this time will
    always 00:00.
    To see the resulting XML
    can replace
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
    <xmp><xsl:copy-of select="*"/></xmp>
    </xsl:template>
    </xsl:stylesheet>
    Where you see the format
    of "write"
    http://msdn.microsoft.com/en-us/library/ms546985(v=office.14).aspx
    Miguel de Hortaleza

Maybe you are looking for