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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help building a total query 1

Status
Not open for further replies.

sk8er1

Programmer
Jan 2, 2005
229
US
I was trying to do a total query today. The data in the query resembles this....

CustomerName Type City State
----------- ---- ------- ------
CustomerABC FF St. Louis, Mo
CustomerABC FF St. Louis, Mo
CustomerABC FD ""
CustomerBCD FF New York
CustomerBCD FF ""
CustomerBCD FF
CustomerBCD FF
...
I was trying to get it to total up the type...
where customerABC would have 2 for FF and 1 for FD
and CustomerBCD 4 for FF....
How can this be done in the query tool....



 
In the SQL pane of the query tool:
SELECT CustomerName, Type, Count(Type) AS CountOfType
FROM yourTableName
GROUP BY CustomerName, Type

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
The only thing I forgot to mention is that the query is a few tables linked by an account number...
Its not a one table query....
I will try your code Thanks
 
Absolutely perfect!!!!!!!!!! Thank you so much!!!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top