Help with a Query

  • Thread starter Thread starter Hulicat
  • Start date Start date
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?
 
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
 
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
 
Back
Top