David Bicking <dbic...@yahoo.com> wrote: > The calculation is that for each customer: > MSO = (Per + (AR-sum(Sales)/Sales)) > > Result > Cust MSO > 000001 2.3 = (3+(100-120)/60))
You have more closing parentheses here than opening ones. If we ignore the rightmot closing paren, the grouping of actual numbers doesn't match the grouping of variables in the formula. What is being divided by Sales: sum(Sales) or (AR - sum(Sales)) ? Further, (3+(100-120)/60) == 2.7, not 2.3. Your example doesn't add up. > Hopefully I described that in a meaningful way. Is it possible to do that > efficiently or at all using SQL? I'd bet it is possible (I might take a stab at it once you clarify the problem statement), but I doubt it'd be efficient. -- Igor Tandetnik _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users