Re: [sqlite] Calculating MSO

2011-12-16 Thread Igor Tandetnik
David Bicking wrote: > I need to calculate Months Sales Outstanding. > > CREATE TABLE AR > Cust Text > AR Double > > CREATE TABLE Sales > Cust Text > Per Integer -- runs 1, 2, 3, etc > Sales Double > > > The calculation is that for each customer: > MSO = (Per +

Re: [sqlite] Calculating MSO

2011-12-16 Thread David Bicking
To: sqlite-users@sqlite.org Sent: Friday, December 16, 2011 4:05 PM Subject: Re: [sqlite] Calculating MSO David Bicking <dbic...@yahoo.com> wrote: > The calculation is that for each customer: > MSO = (Per + (AR-sum(Sales)/Sales)) > > Result > Cust MSO > 01 2.3 = (3+(100-120)

Re: [sqlite] Calculating MSO

2011-12-16 Thread Igor Tandetnik
David Bicking wrote: > The calculation is that for each customer: > MSO = (Per + (AR-sum(Sales)/Sales)) > > Result > Cust MSO > 01 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

[sqlite] Calculating MSO

2011-12-16 Thread David Bicking
I need to calculate Months Sales Outstanding. CREATE TABLE  AR     Cust    Text     AR    Double CREATE TABLE Sales     Cust    Text     Per    Integer -- runs 1, 2, 3, etc     Sales    Double The calculation is that for each customer: MSO = (Per + (AR-sum(Sales)/Sales))        Where Per