Re: Sum of Sales

2005-10-27 Thread Daniel Bowett
Michael Stassen wrote: Daniel Bowett wrote: Michael Stassen wrote: Daniel Bowett wrote: Peter Brawley wrote: Dan, />...Total sales for ever would be a simple GROUP BY query with a >sum on the sales - but I cant see how I am going to get this info. >Do I need to use nested queries? / Y

Re: Sum of Sales

2005-10-26 Thread Michael Stassen
Daniel Bowett wrote: Michael Stassen wrote: Daniel Bowett wrote: Peter Brawley wrote: Dan, />...Total sales for ever would be a simple GROUP BY query with a >sum on the sales - but I cant see how I am going to get this info. >Do I need to use nested queries? / You don't need nested quer

Re: Sum of Sales

2005-10-26 Thread Peter Brawley
Dan, If you don't want the query to stop with the current month, drop the WHERE clause. PB Daniel Bowett wrote: Michael Stassen wrote: Daniel Bowett wrote: Peter Brawley wrote: Dan, />...Total sales for ever would be a simple GROUP BY query with a >sum on the sales - but I cant see

Re: Sum of Sales

2005-10-26 Thread SGreen
news <[EMAIL PROTECTED]> wrote on 10/26/2005 04:02:33 PM: > Michael Stassen wrote: > > Daniel Bowett wrote: > > > >> Peter Brawley wrote: > >> > >>> Dan, > >>> > >>> />...Total sales for ever would be a simple GROUP BY query with a > >>> >sum on the sales - but I cant see how I am going to get t

Re: Sum of Sales

2005-10-26 Thread Daniel Bowett
Michael Stassen wrote: Daniel Bowett wrote: Peter Brawley wrote: Dan, />...Total sales for ever would be a simple GROUP BY query with a >sum on the sales - but I cant see how I am going to get this info. >Do I need to use nested queries? / You don't need nested queries. It's a crosstab or

Re: Sum of Sales

2005-10-26 Thread Michael Stassen
Daniel Bowett wrote: Peter Brawley wrote: Dan, />...Total sales for ever would be a simple GROUP BY query with a >sum on the sales - but I cant see how I am going to get this info. >Do I need to use nested queries? / You don't need nested queries. It's a crosstab or pivot table query. The

Re: Sum of Sales

2005-10-26 Thread Daniel Bowett
Peter Brawley wrote: Dan, />...Total sales for ever would be a simple GROUP BY query with a >sum on the sales - but I cant see how I am going to get this info. >Do I need to use nested queries? / You don't need nested queries. It's a crosstab or pivot table query. The trick is to sum into on

Re: Sum of Sales

2005-10-26 Thread SGreen
news <[EMAIL PROTECTED]> wrote on 10/26/2005 09:46:49 AM: > I am unsure how to write this query, can someone help? > > I have two tables. > > One has a list of retailers (tbl_retailer): > > retailerid > name > postcode > > e.g. > > 1 Sprocket Supplies CH23 4PY > > The other has the sales

Re: Sum of Sales

2005-10-26 Thread Peter Brawley
Dan, >...Total sales for ever would be a simple GROUP BY query with a >sum on the sales - but I cant see how I am going to get this info. >Do I need to use nested queries? You don't need nested queries. It's a crosstab or pivot table query. The trick is to sum into one column per desired y

Sum of Sales

2005-10-26 Thread Daniel Bowett
I am unsure how to write this query, can someone help? I have two tables. One has a list of retailers (tbl_retailer): retailerid name postcode e.g. 1 Sprocket Supplies CH23 4PY The other has the sales by month for each retailer: retailerid month_2 sales e.g. 1 2004-01 100 1 200