• Hi,

    you need to use the row_number function to identify which specific rows you want returned. Change the order by clause if you want the oldest record.

    create table # (SKU# varchar(10), Description varchar(128), SalesDate datetime)

    insert #

    select '01110', 'Red Car with stripe', '01/19/2009'

    union all select '01110', 'Red Car with line', '02/01/2009'

    union all select '01110', 'Red Car with laser', '02/25/2009'

    union all select '01120', 'Blue Car with stripe', '01/19/2009'

    union all select '01120', 'Blue Car with line', '02/01/2009'

    union all select '01120', 'Blue Car with laser', '02/25/2009'

    select [sku#], [description], [SalesDate] from

    (select *, row_number() over (partition by SKU# order by salesDate desc) as rownum from #) x

    where rownum=1

    Bevan