Recent Date query

Results 1 to 2 of 2

Thread: Recent Date query

  1. #1
    Selva Raj Guest

    Default Recent Date query

    Trying to display records from Oracle DB. In the DB the fields I want are ClientName, Correspondent, DateCreated(Correspondent) .....<BR>Ex: <BR>ClientName----Correspondent-----DateCreated<BR><BR>ABC------------AAA----------------01/30/99<BR>ABC------------BBB----------------05/30/00<BR>ABC------------CCC----------------07/25/01<BR><BR>So If I search for ABC, I will get all 3 records. But I need to display the current Correspondent record only, which is based on DateCreated.<BR><BR>My question is how do I get only the record which has the most recent date? There are no unique field I could get this from other than the DateCreated Field.<BR><BR>Any help is appreciated.<BR>Selva<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Recent Date query

    Like this?<BR><BR>select * <BR>from myTable<BR>where ClientName = &#039;ABC&#039;<BR>and DateCreated = max(DateCreated);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts