• Hi Jordon,

    As you probably realise, SQL 2000 doesn't have CTEs or RowNumber.

    I was happy to discover CTEs precisely because I'm hopeless at doing queries like the one below!! So here's something to get you started...

    ...but I'm sure someone will chip in with a complete / better solution.

    select currow.ItemId,

    ( select max(PriceStartDate)

    from PriceHistory phPrev

    where phPrev.PriceStartDate < currow.PriceStartDate

    and phPrev.ItemId=currow.ItemId

    ) as OldPrice,

    currow.PriceStartDate,

    currow.Price

    from PriceHistory currow

    Change the smiley for a closing bracket.

    Hope this helps....

    David.