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

Access SQL - Select maximum number of times date appears. 1

Status
Not open for further replies.

nickodvz

IS-IT--Management
May 24, 2008
5
AU
Ok, I'm pretty new to this stuff - but I need a bit of help.
Here is my query so far:

SELECT Collars.Date, Count(Collars.Date) AS [CountofDate]
FROM Collars
GROUP BY Collars.Date
HAVING max(countofdate);

Hold on, maybe I've got it wrong.
What I want to do is, select the maximum number of jobs done in a day (each job has its own entry, so there are multiple entries of the same date, I want to count how many times each date is there - and then select the max from this) how do I do this in one query? I can't remember, is there a way to create a temporary table? In which case - how do I do that for what I need?
Thanks for your help.
 
Code:
SELECT TOP 1 [Date], Count([Date]) AS [CountofDate]
FROM Collars
GROUP BY [Date]
ORDER BY 2 DESC
 
Ok. You are awesome. Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top