simple sum question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table with a 4 fields, customer name, order number, price and
product name. I want to be able to select customer name and orders and do a
sum of the prices to display the total on my ASP page. How can I do SQL to
create a record set to display this?

many thanks

Ted
 
Hi Ted,

I'm not an ASP guru, but something like this should be close:

SELECT [customer name], Sum(price) AS [Total Purchased]
FROM [YourTableName]
GROUP BY [customer name];


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

:

I have a table with a 4 fields, customer name, order number, price and
product name. I want to be able to select customer name and orders and do a
sum of the prices to display the total on my ASP page. How can I do SQL to
create a record set to display this?

many thanks

Ted
 
Are you looking for the total price per order? If so, the SQL would be ...

SELECT [customer name], [order number], Sum(price) AS TotalPrice FROM
TableName GROUP BY [customer name], [order number]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top