Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with Sum Query 1

Status
Not open for further replies.

Scorez2000

Programmer
Feb 5, 2004
87
GB
I've been having trouble creating a query for a report.

Here's a snippet of the raw data.

Name---Cost--Assigned
Wayne - 21 - Buisness
Wayne - 33 - Personal
Wayne - 25 - Personal
Wayne - 55 - Business
James - 10 - Personal
James - 10 - Business
james - 91 - Personal


I would like to run a query that will return two columns with the totals for personal and business for each user. Thus, the reusltant query run on the data above would give:

Name-Personal-Business
Wayne - 58 - 76
James - 101 - 10

All help is appreciated. Thanks in advance.
 
Look for crosstab query

________________________________________
Zameer Abdulla
Visit Me
Hold your child's hand every chance you get.
A time will come when he or she won't let you.
 
I think what you meant to say was "Good read up on SQL instead of asking NOOB questions on a forum." LOL.

Thanks for the advice. I'll read up on crosstab queries.

Wayne.
 
Never.. I just direct you to the right way. May be the language is harsh as I am not a native english speaker. some time I am very lazy to type

________________________________________
Zameer Abdulla
Visit Me
Hold your child's hand every chance you get.
A time will come when he or she won't let you.
 
Thanks for the advice. I managed to create the query after reading a little on Crosstabs. I still do not understand it fully, but I managed to create the query.

Thanks for the advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top