• Sean Lange (10/10/2012)


    As Michael said you need the TOP when using a derived table and an ORDER BY.

    What I don't understand is why there is a need to have an order by in the derived table. The order is pointless in this case. It seems that you could remove the top 100 percent AND the order by in the derived table.

    Thanks for replies. I may have figured it out. It looks like another part of the query relies on the records being a specific order so it can do some differential calcs. I'm sure there's a better way, jut got to try and figure out everything else the query is doing

    Regards

    Mark