Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Posts
    2

    Unanswered: Select Record with Latest Date

    I have a table of Address Numbers by effective date. I want to return the Current/Effective Address Numbers. For example,

    Record # Address # Effective Date
    1 10111 01/31/04
    2 10111 03/31/04 (Would Like this record returned)
    3 10234 01/01/03
    4 10234 02/15/04 (Would Like this record returned)

    If I use the "Select Top 1 from TABLE Order by Effective Date", it only returns record #2. In the example above, I want record #2 and #4 returned. Any thoughts would be greatly appreciated.

    Thanks.

  2. #2
    Join Date
    Jul 2003
    Posts
    73
    Code:
    SELECT AddressNo, MAX(EffectiveDate)
    FROM TABLE
    GROUP BY AddressNo
    Or do you actually want to know the RecordNo as well?
    Joel Dixon
    Analyst Programmer
    Melbourne, Australia

Posting Permissions

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