• If I've understood correctly what is wanted, it could be

    select h.*, c.*

    from Contact c

    inner join (

    select top 1 h1.* from History h1

    inner join (select Accountno, max(LastDate) LastDate from History group by Accountno) L

    on h1.Accountno = L.Accountno and h1.LastDate = L.LastDate) h

    on h.Accountno = c.Accountno

    Tom