Re: Group By - SQL Question?

Tech-Archive recommends: Fix windows errors by optimizing your registry



abstract_daze@xxxxxxxxx wrote:
I have a table with the following:

Id Name amount Date

1 JOHN SMITH 10.00 8/1/2006
2 JOHN SMITH 20.00 8/5/2006
3 MARY JONES 50.00 5/5/2006
4 MARK LONG 25.00 4/4/2006
5 MARK LONG 5.00 5/8/2006


I WOULD LIKE THE SQL RESULTS TO LOOK LIKE THIS:

NAME AMOUNT(SUM) ID1 ID2

JOHN SMITH 30.00 1 2
MARY JONES 50.00 3
MARK LONG 30.00 4 5

How can I accomplish this - I am most concerned in
getting the NAME & SUM fields but if I could get the IDs
on the same row that would be great!
Any help is greatly appreciated!

A crosstab query might do this if there aren't too many unique ID values.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


.



Relevant Pages

  • Re: access97, more than 32 indexes on a table, time to move to MSDE / sql
    ... is now the time to move to msde or sql / server? ... Rick Brandt, Microsoft Access MVP ... RBrandt at Hunter dot com ...
    (comp.databases.ms-access)
  • Re: SQL query with variable
    ... but you could use code to re-write the SQL in the query each time. ... RBrandt at Hunter dot com ...
    (microsoft.public.access.queries)
  • Re: Queries using the <> command
    ... > This is the statement in sql view that only excludes ... RBrandt at Hunter dot com ...
    (microsoft.public.access.queries)
  • Re: SQL Queries Questions
    ... "Seikyo" wrote in message ... > I use several SQL to do the stuff and Macro to link them I think. ... > will be a big trouble when the database get larger. ... Almost certainly there is a simpler way to accomplish what you want ... ...
    (microsoft.public.access.modulesdaovba)
  • Re: Query
    ... What does the pound sign ... accomplish in sql? ... select * from tblYourTableHere ...
    (comp.databases.ms-access)