Help with a Query

H

Hulicat

I know very little in regards to Access the syntax apparently is
different than MSSQL.

I have the following table that looks like this.

Table A
Name Price
Tom 111
Tom 158
Tom 222
John 153
Steve 586
Steve 222

Desired output:
Name Price
Tom sum for john
John ""
Steve ""

Distinct does not seem to work in Access?
 
V

vanderghast

I assume you meant sum for "Tom", not for "John".


SELECT name, SUM(price)
FROM tableA
GROUP BY name


which is exactly the same as for MS SQL Server.



Vanderghast, Access MVP
 
H

Hulicat

I assume you meant sum for "Tom", not for "John".

SELECT name, SUM(price)
FROM tableA
GROUP BY name

which is exactly the same as for MS SQL Server.

Vanderghast, Access MVP










- Show quoted text -

Thanks a lot....that's what I get for using the "Builder"; that
builder thing is horrible IMO

Thank you...

Regards
 

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

Top