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

Query Help

Status
Not open for further replies.

juskor

Technical User
Jun 28, 2005
2
US
Okay i have a table:
Date
Hostname
Message

I would like to setup a query that would report back the top 10 hostnames that have the most messages between a certain date?

Thanks for any suggestions.
 
SELECT TOP 10 Hostname, Count(*) As CountOfMessages
FROM yourTable
WHERE [Date] Between [Enter start date] And [Enter end date]
GROUP BY Hostname
ORDER BY 2 DESC;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Works great, exactly what I wanted.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top