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

query: values to be use in a chart

Status
Not open for further replies.

taliz

Technical User
Jun 3, 2003
4
PA
Hello, please help me with this. I know it could be easy, but a have no experience working with queries.

I want a query that will shows values to be use in a chart. The query combines fields from two tables.

The first one has the following fields

Entity Type
Name1 Government
Name2 Enterprice
Name3 Particular

The second table has:
Entity Request Number* Date
Name1 100 June
Name2 101 June
Name3 102 July

*The request number is an autonumeric number generated for each request.

What I want is to count the requests grouped by entity types per each month, like

Month July
Numbers of requests Entity
20 Goverment
10 Enterprice
15 Particular

Thanks
 
Something like this ?
SELECT A.Date As [Month], Count(*) As [Numbers of requests], B.Type As [Entity]
FROM yourSecondTable A INNER JOIN yourFirstTable B ON A.Entity = B.Entity
GROUP BY A.Date, B.Type
;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top