• Another is to do an INNER JOIN to a subquery for the CustID and MAX(EndDate), joined on both fields.

    A third method would be to put the above subquery into a CTE and join to the CTE.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.