• Thanks for a very fast reply!

    Unfortunately ISNULL(substat,0) errors out with "Invalid column name 'substat'."

    I have inherited this query, where i needed one extra column to be able to sort on 'Substat', or more specific to sort on SubGroupType.

    I think, that the reson behind the subqueries is the formatting.

    To rewrite the query is a bit ower my head - To add the 'substat' line was difficult enough.

    Best regards

    Edvard Korsbæk