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 neste

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. I

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

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