Thank you. That saved many hours. Next question; I want to ultimately use my 
data to generate a bar chart showing the best years and one showing the best 
months over the years. In looking at R:Charts the bar graph requires a 
sequential field, so my next question is, how do I go from this:
CaseYear     | CaseCount

2010            |         13
1995            |         11                Not a pretty chart
2013            |         10

to:
Row# |  CaseYear     | CaseCount

1         |2010            |         13
2         |1995            |         11         Pretty chart
3         |2013            |         10

I have taken the help you have given me and created a view. But for some reason 
when I insert the TOP 12 into the SELECT, the view only generates one row. I 
have been able to do this in two step, which I can live with, but the best help 
would be how to insert a row counter for my final view. Any ideas.

I wrote the my original accounting program in 1988, updated it in 1994, and we 
have been using it ever since, unmodified. That was when it was R:Base 4.5+. 
Then came Windows 8.0 and my dos base program would not work. My choice was to 
buy something else and start over or convert to 9.5. I am a little rusty as 
programming is not my first calling. Although, I have found it intellectual 
challenging. My conversion is complete and my updated accounting program goes 
online, replacing my R:Base 4.5+, when our new compute comes in, in the next 
few days.
 
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. 


On Wednesday, May 28, 2014 7:12 PM, Albert Berry <[email protected]> wrote:
 


I think what you need to see is the COUNT(DISTINCT NameOfAthlete) which only 
counts each identical name as 1, no matter how many results there are. 

SELECT SeasonCCYY, COUNT(DISTINCT NameOfAthlete) +
FROM IndividualResults  +
WHERE ETInSeconds > 0 +
GROUP BY SeasonCCYY +
ORDER BY 2 Desc +

Albert


On 5/28/2014 4:10 PM, Wills, Steve wrote:

 
>Zeb, I probably should have simplified this; I just took a previously existing 
>query and tested it, then pasted it, but, related to what I think your need 
>is, the following might have been better:
> 
>SELECT     SeasonCCYY,
>COUNT(NameOfAthlete) 
>FROM       INDIVIDUAL_RESULTS 
>WHERE      ETInSeconds <> 0 
>GROUP BY 
>SeasonCCYY 
>ORDER BY 
>2 DESC
> 
>Translation:
> 
>Get        the year,
>           total number of runners
>from       individual performance records
>where      the runner crossed the finish line
>grouped by
>           the year
>ordered by
>           how many finishers during the season from most to least
>           
> 
> 
> 
>From:[email protected] [mailto:[email protected]] On Behalf Of Wills, Steve
>Sent: May 28, 2014 4:38 PM
>To: RBASE-L Mailing List
>Subject: [RBASE-L] - Re: Date Where Max(CaseCount) Occurs
> 
>Zeb (and Bill), what about something like this:
> 
>SELECT     SeasonCCYY,
>NameOfSchoolCD, 
>COUNT(NameOfAthlete) 
>FROM INDIVIDUAL_RESULTS 
>WHERE      ETInSeconds <> 0 
>AND        NameOfSchoolCD IN ('SAA','SDS') 
>GROUP BY 
>SeasonCCYY, 
>NameOfSchoolCD, 
>ORDER BY 
>2, 
>3 DESC
> 
>Translation:
> 
>Get                  the season,
>name of the school
>how many runner names
>from                individual results table
>where              performance/elapsed time has a positive integer value
>and                  name of the school is for my girls and my boys teams
>group by
>                        the season,
>                        name of the school
>order by
>                        name of the school (to keep boys and girls counts 
>together)
>how many runner names from most to least (IOW, which year’s team has had the 
>most runners)
> 
> 
>From:[email protected] [mailto:[email protected]] On Behalf Of Bill Downall
>Sent: May 28, 2014 4:23 PM
>To: RBASE-L Mailing List
>Subject: [RBASE-L] - Re: Date Where Max(CaseCount) Occurs
> 
> 
>On Wed, May 28, 2014 at 5:18 PM, A. Razzak Memon <[email protected]> wrote:
>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.
>
>Zeb,
> 
>You can combine your two queries into one:
> 
>SELECT CaseYear FROM GroupCaseCountByYear +
>  WHERE CaseCount = (SELECT MAX (CaseCount) FROM GroupCaseCountByYear)

Reply via email to