• The only difference I can find is in the join between SalesOrderDetail and SalesOrderHeader. The problem is that I would believe that the first option is correct and the second one is incorrect.

    The order of the joins won't make any difference with inner joins in this case (it might give you a syntax error if you want to use a column from a table before it's mentioned on a JOIN clause).

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2