By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,841 Members | 1,736 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,841 IT Pros & Developers. It's quick & easy.

Calculating in a Query Dilemma

P: 3
I'm attempting to create a query that will sum data based on a certain field.
i.e.
Column 1-Date
Column 2-Pitches Thrown on That Day
Column 3-Pitchers Name

I'd like the query to count the total number of pitches thrown by each pitcher on a user-specified time frame ([Start Date]<[End Date]) and, if possible, count the occurences of records for that pitcher as well (would be the # of starts this season). Any help is appreciated!
Aug 6 '07 #1
Share this Question
Share on Google+
5 Replies


Rabbit
Expert Mod 10K+
P: 12,389
Ok, what have you tried so far?
Aug 6 '07 #2

P: 3
I have a dlookup() expression set up in a column of the query - and I know what's wrong, I just don't know how to fix it! (My last statement in the expression points to itself - "[Name]=[Name]"... I just don't know what to put to get it to 'loop' through)

Right now the query is just pulling the first record found so - easiest way to put it:

What I want:

Date Name Pitches Thrown Total Pitches Thrown
1/1/07 John Smith 17 17
1/13/07 Mark Johnson 13 13
1/17/07 John Smith 9 26
1/22/07 Mark Johnson 22 35


What I'm getting:

Date Name Pitches Thrown Total Pitches Thrown
1/1/07 John Smith 17 17
1/13/07 Mark Johnson 13 17
1/17/07 John Smith 9 17
1/22/07 Mark Johnson 22 17
Aug 6 '07 #3

Rabbit
Expert Mod 10K+
P: 12,389
Have you tried using the totals? In Query Design, click View > Totals. This lets you set up an aggregate query and grouping values.
Aug 6 '07 #4

P: 3
That worked! Thanks.
Aug 10 '07 #5

Rabbit
Expert Mod 10K+
P: 12,389
That worked! Thanks.
Not a problem.
Aug 10 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.