Discoverer: Capturing record with the latest date among others

Hi there,
I would appreciate if anyone can help me in Discoverer10g Report. The report gives me the following results. Let me know if any more info needed.
Example:
Plan Cov St Dt Amt Elec. Dt Name Rt St dt Comm Ann Enrl Cov St Dt
Basic Life     01-JAN-2011     76000.00     11-NOV-2010     Stephanie     01-JAN-2011          2.63      68.40     11-NOV-2010     
Basic Life     01-JAN-2011     76000.00     29-OCT-2010     Stephanie     01-JAN-2011          2.63      68.40     29-OCT-2010     (Yes)
Basic Life     01-JAN-2011     177000.00     29-OCT-2010 Shanika     01-JAN-2011          6.13      159.30     29-OCT-2010     (Yes)
Basic Life     01-JAN-2011     214000.00     19-NOV-2010     Nicole     01-JAN-2011          7.41      192.60     19-NOV-2010     (Yes)
Basic Life     01-JAN-2011     214000.00     29-OCT-2010     Nicole     01-JAN-2011          7.41      192.60     29-OCT-2010
What I want to capture is latest date record from available records of the same employee and if there is only one record, I would want that too. In short, the ones which has '(yes)' at the end.
What function can I use to get the desired results.
Thank you!
NN

Hi Tamir,
I used the the function(for another report which has similar situation) you mentioned but it gives me an error saying-
ORA-01858: a non-numeric character was found where a numeric was expected.
Its is OAB module indeed. some how due to date issue during our Insurance Vendor changes, I get multiple records of the same employees with some blank fields. See the example below.
*4.36     07-AUG-2010     31-DEC-4712     07-AUG-2010     07-AUG-2010     21206*
NULL     07-AUG-2010     31-DEC-4712     07-AUG-2010          21206
3.95     01-JAN-2010     31-DEC-4712     01-JAN-2010     01-JAN-2010     21206
Now out of three I need the one in bold letters. and there are other employees having just one record like
Amt   Cov_St_DT         Cov_End_Dt       Rate_St_Date    Rt_Effective Dt  EEID
1.45     15-SEP-2010     31-DEC-4712     15-SEP-2010     15-SEP-2010     22777
7.65     01-JAN-2010     31-DEC-4712     01-JAN-2010     01-JAN-2010     21298
so I need the single records as well as latest(date) record of multiple records of one employee.
Let me know if you need more information.
One more thing- is there any way to see the actual query I am running?(not sql Inspector)
Thank you!
797174
p.s Thank you for the earlier reply.
Edited by: 797174 on Dec 21, 2010 2:18 PM

Similar Messages

  • Finding the record with the latest date

    Post Author: sconlon
    CA Forum: General
    Hi,I am using CR 8 with an Access database which has a table that holds (multiple) sales records for each of our clients. I want to create a report that lists only the latest sale from each client.  I am thinking that I first need to group by client and then create a sub-report that prints the necessary details of sales record with the latest date of sale.  It's this last bit that I cannot figure out how to do.  Can anyone suggest a way of doing this?Many thanks,sconlon

    Post Author: Jagan
    CA Forum: General
    Charliy's suggestion if fine, and does require sorting and displaying in the group header/footer according to the sort order. In case it's not clear, when you print in the group header you are using the first record's data; when you print in the group footer you are using the last record's data (first and last within the group that is).
    Personally, I'd group on the client have a group selection formula of:
    {table.date_field} = maximum({table.date_field}, {table.client_id})
    so that there's no date sort required as you'll only get one record per client group - assuming that each record has a unique date of course. I'd probably still suppress the details section and display in the group footer, but it wouldn't matter if you use the details section either.
    I believe the benefit with the group selection formula is that any summary formulas, running totals etc. you use would only have the one record per client to work on, rather than including all of the suppressed records too.

  • Select the one record with the latest record

    I have the following table called tblSales:
    SKU   TransDate   Color
    ===   ======  ====
    123   1/1/2015    Red
    123   1/2/2015    Red
    123   1/5/2015    Red
    123   1/1/2015    White
    123   1/2/2015    White
    123   1/3/2015    White
    123   1/1/2015    Blue
    123   1/2/2015    Blue
    123   1/5/2015    Blue
    I need to create a query along the lines "SELECT the latest record FROM tblSales WHERE Color = 'White''
    In this example, the record dated 1/3/2015 would be the result.  I know that MAX(TransDate) is used here, but not sure how.
    Thanks.
    Ken

    Karl,
    I had already tried that.  It returns all 3 records having SKU = 123 and Color = White.
    Worst case scenario is I can always search for White 123s using a query with TransDate DESC and then get the first record.  I was just hoping for something a bit more elegant.
    Thanks for your help though.
    Ken

  • Return a record with the newest date.

    I have a table called credit, and the following columns:
    Rep_Date
    Rep_Name
    Rep_Code
    Rep_Plan
    I am looking for a query that will return only the record based on the most recent Rep_date, this record will then be joined to another table based on the Rep_Code and Rep_Plan, so really this will be a subquery to a larger query.
    Sample Data
    Rep_Date Rep_Name Rep_Code Rep_Plan
    01/01/2010 Jeff 1 B
    09/09/2009 Jeff 1 B
    05/05/2009 Jeff 1 B
    The result should only return the following
    01/01/2010 , Jeff , 1 ,B
    Thanks

    Welcome to the forum.
    The MAX aggregate function should do it as well:
    select max(rep_date) rep_date
    ,      rep_name
    ,      rep_code
    ,      rep_plan
    from   credit
    group by rep_name
    ,        rep_code
    ,        rep_plan;Since you're new to SQL, it is always helpful to do some searches and read (and learn) a bit on these sites as well:
    http://asktom.oracle.com
    http://tahiti.oracle.com/pls/db112/homepage
    http://tahiti.oracle.com/pls/db112/to_toc?pathname=server.112/e10713/toc.htm

  • Select record according to latest date

    I have two fields in my DB table , one is region and other is date .
    There are many records for region (R1 lets say).
    My requirement is that I want the record (only one record) with the latest date for this region .

    hi,
    try like this.
    SELECT - aggregate
    Syntax
    ... { MAX( [DISTINCT] col )
        | MIN( [DISTINCT] col )
        | AVG( [DISTINCT] col )
        | SUM( [DISTINCT] col )
        | COUNT( DISTINCT col )
        | COUNT( * )
        | count(*) } ... .
    Effect
    As many of the specified column labels as you like can be listed in the SELECT command as arguments of the above aggregate expression. In aggregate expressions, a single value is calculated from the values of multiple rows in a column as follows (note that the addition DISTINCT excludes double values from the calculation):
    MAX( [DISTINCT] col ) Determines the maximum value of the value in the column col in the resulting set or in the current group.
    MIN( [DISTINCT] col ) Determines the minimum value of the content of the column col in the resulting set or in the current group.
    AVG( [DISTINCT] col ) Determines the average value of the content of the column col in the resulting set or in the current group. The data type of the column has to be numerical.
    SUM( [DISTINCT] col ) Determines the sum of the content of the column col in the resulting set or in the current group. The data type of the column has to be numerical.
    COUNT( DISTINCT col ) Determines the number of different values in the column col in the resulting set or in the current group.
    COUNT( * ) (or count(*)) Determines the number of rows in the resulting set or in the current group. No column label is specified in this case.
    reward if useful.

  • Filter records with month and date

    Hi,
    i have records as follows in the table.
    custno trn_dt amount
    1 01-jan-06 100
    1 10-jan-06 200 --->
    1 15-feb-06 300
    2 15-dec-06 111
    2 15-jan-06 222 --->
    2 01-fen-06 333
    If i specify the runtime parameter as JAN-06 the output of the report should be with 2 records indicated with arrows above.
    the query should pick up the record with the highest date for a specific customer.
    in the above example for customer "1" 10-jan-06 is highest date and for customer "2" 15-jan-06 is the highest date.
    hope the requirement is clear.
    thanks in advance

    SELECT custno, trn_dt, amount
    FROM TABLE
    WHERE (custno,trn_dt) IN
    (SELECT custno, MAX(trn_dt)
    FROM TABLE
    GROUP BY custno)
    There are many examples on this in SQL and PL/SQL forum.

  • Create a node with the newest date only

    Hi, I want to create a node in the target, only by the newest date from the source. The source is an Idoc with, say, 3 segments of the same kind, with different dates. Only the segment with the newest date, should be created in the target.
    Any Ideas?

    Hi,
    it's easy but with user defined functions:
    - put all segments into the UDF
    - then inside this UDF choose the one with the
    latest date and put it into the array (global variable)
    - then take the values from the global variable
    to fill the sements (from new UDFs)
    you could also try with
    DateBefore and DateAfter functions
    and try to do it without UDFs
    with logic like
    if date1 DateBefore date2 then ....
    Regards,
    michal

  • GoPod - Does it work with the latest Ipod firmware?

    I have a 5th Gen 60gb iPod and have used goPod in the past to remove the volume cap. But ever since updating my iPod with the latest firmware the volume limit seems to be very quiet compared to what it used to be. Is this because goPod 1.4 doesn't work with the latest firmwire?
    Has anyone else had this problem or is it just me going deaf?
    Cheers

    I disagree with that rudolfraith.
    When I plug my iPod in, launch goPod and then press uncap, it does say that it is now uncapped, but the volume limit is no difference at all. I even tested this by hooking my Ipod up to my PC and recording it capped and uncapped, the levels were exactly the same.
    So I feel that goPod v1.4 doesn't work with the latest firmware.

  • Bad Form from Apple with the latest update

    Update 11.1.4 was obviously released without being fully tested.
    Given that it was released in early January and it is now the 29th I would have thought Apple would have given a "fix" top priority.
    I wasted a huge amount of  time and  effort redownloading and trying many different things before giving up in frustration.
    Eventually I managed to locate a post made by Turingtest2 on the Support community which allowed me to fix the problem. Thank you Turingtest2!
    Why is Apple relying on its customers to solve its problems?

    Hello sfhowes,
    Thank you for your response.
    I have looked into this thread that you've suggested earlier, but I'm hesitant to download a 3rd party application to fix the problem.
    This thread also references much longer hang times for autocomplete.
    What we're seeing in our office is very small, on the order of 0.1 seconds.
    It's enough of a change though that it's causing headaches in our office b/c we were used to instantaneous autocomplete.
    The preferred solution would be to have Mozilla undo or fix the change that they made that resulted in the decreased performance with the latest update.

  • How to pull the job with the latest effective date in PSFT?

    Hello,
    I am running the PSFT 9.1.1 connector workforcefullsync.
    I ran into a problem when the user has multiple job records. Each time that the user job is updated, a new job record is created. So, when the data comes from PSFT, for a user, we have multiple jobs records with different effective date (For example <EFFDT IsChanged="Y">1996-10-21</EFFDT>). OIM is only interested in the latest EFFDT.
    Question 1: is it something that we can set on the PeopleSoft side, so that only the job with the highest EFFDT is sent to OIM?
    Question 1b: is this is not easy to accomplish from the PSFT side, can I use transformation in the connector to only pull the job record with the highest effective date?
    Question 2: if the EFFDT shows a date in the future (HR wants to disable a person in the future), does OIM ignore this change until the sysdate is after that EFFDT date?
    Thanks
    PS: workforcefullsync worked fine if the file contains only 1 job per employee. When the xml files contain multiple job records, I got the error:
    ERROR QuartzWorkerThread-1 OIMCP.PSFTER - oracle.iam.connectors.psft.common.handler.impl.PSFTWorkForceSyncReconMessageHandlerImpl : handleMessage
    ERROR QuartzWorkerThread-1 OIMCP.PSFTER - 1
    ERROR QuartzWorkerThread-1 OIMCP.PSFTER - Description : 1
    ERROR QuartzWorkerThread-1 OIMCP.PSFTER - java.lang.ArrayIndexOutOfBoundsException: 1
    Edited by: user12049102 on Mar 22, 2010 12:06 PM

    Hello,
    When the PSFT team sends a message over to OIM to disable a user with today's date, the user got disabled fine in OIM. A reconciliation event is created.
    When the PSFT team sends a message over to OIM to disable a user with a future date for EFFDT, let's say 3/31/2010, no reconciliation event was created.
    Does OIM store this information somewhere so that it will process it later on?
    It's a good thing that OIM does not disable the user who has an EFFDT in the future, but we don't want that record to be forgotten.
    Please help.
    Thanks

  • With the latest version of itunes, are you able to search your library by purchase date?

    With the latest version of itunes, are you able to search your library by purchase date?  My prior itunes software had Name, Time, Artist, Album, Genre, Rating, Plays and Purchased.  With Version 11.0.3 of itunes, 'Purchased' is not a tabbed option to sort.  Can this be added?
    Thanks.

    Hey jeffwcincy,
    Great question, we simply need to check "Purchased Date" from the View Options menu.
    In iTunes 11, click the "View" menu and choose "Show View Options". Located under "Stats" is the "Purchase Date" option.
    Apple - Find Out How - Music - iTunes
    http://www.apple.com/findouthow/music/itunes.html#tips-viewoptions
    Thanks,
    Matt M.

  • HT4587 I downloaded Airport Express Utility 5.6 to get my Airport Express to work with the latest Mac OSX 10.7.4, but when I install and run it, it still says my Airport Express is out-of-date and needs the 5.6 utility.

    I downloaded and installed Airport Express Utility 5.6 to get my old Airport Express to work with the latest Mac OSX 10.7.4, but when I install and run it, it still says my Airport Express is out-of-date and needs the 5.6 utility. What's up?

    It is likely that you downloaded AirPort Utility 5.6.1.  If you checked the requirements, this only runs on Leopard or Snow Leopard Macs.
    You have Lion, so you need AirPort Utility 5.6 for Mac OS X Lion

  • I have an Iphone 4 which I just updated with the latest software, which put in it in Recovery Mode. It has the picture of the plug with Itunes, I downloaded it now its saying its in Recovery Mode, how do I save all of my previous data without Restoring?

    I have an IPhone 4 which I just updated with the latest software, which put in it in Recovery Mode. It has the picture of the plug with ITunes, I downloaded it now its saying its in Recovery Mode, how do I save all of my previous data without Restoring?
    I updated the phone before backing it up on iTunes, now the update wanted me to connect the phone with iTunes and it says the phones in recovery mode and it must be restored before its used with iTunes. I go to click restore and it says it will reset it to factory default and I'll lose all my current data. I have all my sons pictures and videos along with this notes. I can't lose all of this data! Please help!

    You have to restore the iPod, no ifs, ands, or buts...
    After iOS is installed you will be asked if you what to set it up as a new iPod or if you want to restore from a backup.
    If you have a good backup you can restore that and you're good to go.
    If you don't have a good backup, then you end up with a "clean" iPod....

  • I've deleted Adobe Reader 11 and rebooted and reinstalled Adobe Reader 11 and I still get the error message that 'Adobe Reader is blocked because it is out of date'. Using Windows XP with the latest updates (SP3).

    I've deleted Adobe Reader 11 and rebooted and reinstalled Adobe Reader 11 and I still get the error message that 'Adobe Reader is blocked because it is out of date'. Using Windows XP with the latest updates (SP3).

    Screenshots attached to email replies will not make it back to the forum; you need to login to the forum and post it in your topic using the camera icon in the editor.
    Google Chrome is a problem:
    if you use Chrome's own PDF viewer, the results are unpredictable.
    if you use the Adobe Reader plugin with Chrome, it may reject (block) it if it is not the latest version.  Reader 11.0.08 is the latest version for Windows XP, but Chrome may insist on the current version 11.0.10.
    My suggestion; use a different browser!

  • HT201359 Why the ISTORE of Malta is not up to date with the latest movies and series like the UK & USA and why old movies are being uploaded .

    Why the ISTORE of Malta is not up to date with the latest movies and series like the UK &amp; USA and why old movies are being uploaded .
    I believe the apple should be universal in all the products and a small island like Malts should have the same products for sale on ISTORE like of the UK and USA.

    The iTunes and App stores are inherently different in different countries.  Local laws on copyright and other limits on the distribution of intellectual property make it impossible for Apple to simply put everything in every store.  Sometimes, the owner of the intellectual property does not allow it to be distributed everywhere.  Keep in mind that Apple does not own the music, books, movies and such that they allow for sale in their store front, so they do not necessarily have any say in what may, or may not appear in what store.

Maybe you are looking for

  • Need advice for future design and hardware I should purchase now.

    I was wondering if someone could assist me in making a decision on where I should take the future design of my network. Currently the design has no redundancy and I've been told recently that my company has a bit of money to spend and that it needs t

  • How do I take bold off of the desktop icon font on my MacBook Pro?

    I thought I did it in the past, but I can't figure it out now.  I am looking at the desktop icons on my MacBook Pro, and the font is bothering my eyes.  I am trying to take the bold off, but I cannot figure out how to do it.  I saw where to change th

  • Importing VOB - VOB imports only partially

    Hello Comunity! I have a problem importing a DVD (Video_TS) into Premiere Pro (CS5). VTS_01_1.VOB imports correctly, VTS_01_2.VOB imports only a tiny part of the data, the succeeding ..._3.VOB imports correctly again. By using VobEdit.exe, the whole

  • Use Tax and Sales Tax

    Hi , I want to know exactly what is use tax and Sales Tax. and how it is effects the business process if Use tax or sales tax is used. Thanks

  • Problems with HDD

    I have some problems with partitioning my HDD through Boot Camp. I finished the Boot Camp Assistant when it partitioned the Hard Drive. Now, these 120 GB are not accesible! I estimated how much memory take all my files: it's 278 GB, but in the HD pro