WingandaPrayer
Technical User
- May 15, 2001
- 152
Hi,
I'm trying to have the following in One query.
SalesName SalesFigure DateOfSale
Jones 77 1 April 2001
Smith 55 4 April 2001
Jones 87 7 April 2001
Davies 15 1 May 2001
Connell 25 2 May 2001
Wood 40 15 May 2001
Barber 78 30 May 2001
Jones 15 1 June 2001
Smith 20 7 June 2001
Jones 15 12 June 2001
Davies 64 20 June 2001
Connell 63 1 July 2001
Wood 80 15 July 2001
Barber 25 16 July 2001
Wood 15 25 July 2001
To Show this;
April 2001 87 Jones
May2001 78 Barber
June 2001 64 Davies
July 2001 80 Wood
With this
SELECT Format([DateOfSale],"mmmm yyyy" AS SaleMonth, Max(tblTheSales.SalesFigure) AS MaxOfSalesFigure, tblTheSales.SalesName
FROM tblTheSales
GROUP BY Format([DateOfSale],"mmmm yyyy", tblTheSales.SalesName;
I still see all the rows.
If someone would give me a kick start !!
Thanks
David
I'm trying to have the following in One query.
SalesName SalesFigure DateOfSale
Jones 77 1 April 2001
Smith 55 4 April 2001
Jones 87 7 April 2001
Davies 15 1 May 2001
Connell 25 2 May 2001
Wood 40 15 May 2001
Barber 78 30 May 2001
Jones 15 1 June 2001
Smith 20 7 June 2001
Jones 15 12 June 2001
Davies 64 20 June 2001
Connell 63 1 July 2001
Wood 80 15 July 2001
Barber 25 16 July 2001
Wood 15 25 July 2001
To Show this;
April 2001 87 Jones
May2001 78 Barber
June 2001 64 Davies
July 2001 80 Wood
With this
SELECT Format([DateOfSale],"mmmm yyyy" AS SaleMonth, Max(tblTheSales.SalesFigure) AS MaxOfSalesFigure, tblTheSales.SalesName
FROM tblTheSales
GROUP BY Format([DateOfSale],"mmmm yyyy", tblTheSales.SalesName;
I still see all the rows.
If someone would give me a kick start !!
Thanks
David