Hello,
I'm a student working on a problem in MS Access 2003 SP3 on Windows XP, and no matter where I look online I cannot find any help. My book also doesn't help me.
Essentially I need to do the statement:
Max(Sum([SaleItem].[Quantity]*[SaleItem].[SalePrice]))
Though, as you know Access will not allow this. I do not understand how I can achieve this, as the code below will display this:
State SumOfSales
TX 142.30
CA 122.50
MS 32.10
However, what I am really after is simply:
State SumOfSales
TX 142.30
I need the program to calculate the sum of the sales, then I need the max of the sums to be the only thing shown.
Any and all help is appreciated. I'm simply desperate for a solution though no one I speak with seems to know of any.
SELECT City.State, Sum([SaleItem].[Quantity]*[SaleItem].[SalePrice]) AS SumOfSales
FROM ((Customer INNER JOIN Sale ON Customer.Custom erID = Sale.CustomerID ) INNER JOIN SaleItem ON Sale.SaleID = SaleItem.SaleID ) INNER JOIN City ON Customer.CityID = City.CityID
WHERE (((Sale.SaleDat e) Like '7*'))
GROUP BY City.State;
Thanks for your reading and time.
I'm a student working on a problem in MS Access 2003 SP3 on Windows XP, and no matter where I look online I cannot find any help. My book also doesn't help me.
Essentially I need to do the statement:
Max(Sum([SaleItem].[Quantity]*[SaleItem].[SalePrice]))
Though, as you know Access will not allow this. I do not understand how I can achieve this, as the code below will display this:
State SumOfSales
TX 142.30
CA 122.50
MS 32.10
However, what I am really after is simply:
State SumOfSales
TX 142.30
I need the program to calculate the sum of the sales, then I need the max of the sums to be the only thing shown.
Any and all help is appreciated. I'm simply desperate for a solution though no one I speak with seems to know of any.
SELECT City.State, Sum([SaleItem].[Quantity]*[SaleItem].[SalePrice]) AS SumOfSales
FROM ((Customer INNER JOIN Sale ON Customer.Custom erID = Sale.CustomerID ) INNER JOIN SaleItem ON Sale.SaleID = SaleItem.SaleID ) INNER JOIN City ON Customer.CityID = City.CityID
WHERE (((Sale.SaleDat e) Like '7*'))
GROUP BY City.State;
Thanks for your reading and time.
Comment