• I think the table design needs to be re-evaluated...

    Basically there are products, sections and status history per product and section. There might be section groups as well (at least what it looks like, e.g. Design, Modeling and Factory).

    I don't know anything about the business concept, therefore let me ask: Did at least one product got manufactured based on two separate orders a few weeks/month apart?

    If so, was the same or a new productid used for it?

    See what I mean? Design and production don't belong into the same table, since the first happens only once per product (hopefully) but the production should frequently run the product (hopefully, again).

    I strongly recommend to normalize the table structure since it'll help you big time in the future.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]