• The quirky update will handle more than one running total...see

    http://www.sqlservercentral.com/articles/T-SQL/68467/ Fig 19 in the article

    Thanks, J. That is the very article that I'm reading (for the second time... only a dozen more to go :-D). When I say multiple variables need to be updated, I don't mean in the way that the article is updating both a running total and a running count. I don't know if you looked at my sample data or the spreadsheet, but basically it's the same variable but with any number of potential values. I receive product with 75% Ingredient A and 25% Ingredient B then later I receive more of the same product, but this time with 80% Ingredient A, 10% Ingredient B, and 10% Ingredient C. I need to re-calculate the overall percents (combine the ingredient percents from the first receiving with the ingredient percents from the second receiving). If I knew there would only ever be 3 ingredients, I could DIM @IngrArunningTotal, @IngrBrunningTotal, @IngrCrunningTotal, but there can be any number of ingredients on any number of receivings. I thought perhaps I could use a temporary table to store the running totals instead of the variables, but "RULE #5. DO NOT USE JOINS" from Jeff's article indicates that I probably can't do that... Back to reading...