Re: Group By - SQL Question?
- From: "Rick Brandt" <rickbrandt2@xxxxxxxxxxx>
- Date: Thu, 03 Aug 2006 21:15:47 GMT
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
.
- Follow-Ups:
- Re: Group By - SQL Question?
- From: Duane Hookom
- Re: Group By - SQL Question?
- References:
- Group By - SQL Question?
- From: abstract_daze
- Group By - SQL Question?
- Prev by Date: Group By - SQL Question?
- Next by Date: Re: DH Query By Form
- Previous by thread: Group By - SQL Question?
- Next by thread: Re: Group By - SQL Question?
- Index(es):
Relevant Pages
|