What is the best way to locate the date of an event a maximum count occurs?  I 
can find the MAX(CaseCount), but not the associated date.  The UNION worked 
fine for the different date ranges I used to determine MAX(CaseCount), but I 
need to know the actual date. I can find my MAX(CaseCount), but I cannot pull 
up the associated date. If I have a table:GCCBY with two columns:CaseYear(IYR4) 
and CaseCount(Integer); what search would I use to answer the question, what 
year did I have the most cases?

It currently takes me two steps to answer this question: (1)SELECT 
MAX(CaseCount) FROM GroupCaseCountByYear; (2) SELECT CaseYear WHERE CaseCount = 
#. (#--is the number I got from step (1)) This seems counter productive.

What I would like to see is:


R:>SELECT CaseYear, (MAX(CaseCount)) FROM GCCBY(This does not work), and get:

CaseYear     | MAX(CaseCount)
2010            |         13

Any ideas?


 
Zeb Zbranek
Zbranek Firm, P.C.
1937 Trinity Street
Liberty, Texas 77575-2050
Telephone: 936-336-6454
Facsimile:  936-336-6039
 
 
The information contained in this message from Zbranek Firm, P.C. and any 
attachments are confidential and intended only for the named recipients. If you 
have received this message in error, you are prohibited from copying, 
distributing or using the information. Please contact the sender immediately by 
reply e-mail and delete the original message. 

Reply via email to