A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#Name? in text box with unique name



 
 
Thread Tools Display Modes
  #1  
Old September 30th, 2004, 07:57 PM
Richard Hollenbeck
external usenet poster
 
Posts: n/a
Default #Name? in text box with unique name

I think it is the GROUP BY not being equal to anything. I want totals of
all grades from each student. I don't know what to make studentID equal to
(studentID=studentID? Of course not).

=(SELECT Sum([qryCourseGradeDistribution].[current average]) FROM
[qryCourseGradeDistribution] GROUP BY
[qryCourseGradeDistribution].[student])

How can I get around this problem? The text box DOES HAVE a unique name
prefixed with"txt".
Thanks.
RH


  #2  
Old October 1st, 2004, 12:34 AM
John Spencer (MVP)
external usenet poster
 
Posts: n/a
Default

You can't assign a query to a text box control. You can use the DSUM function
(although I do wonder about summing averages).

=DSum("[current average]","[qryCourseGradeDistribution]", "Student=" & [Student])

You may get errors on that depending on whether Student is a number or text
value and whether or not your qryCourseGradeDistribution has any parameters.

If Student is a text value then try
=DSum("[current average]","[qryCourseGradeDistribution]", "Student=" Chr(34) &
[Student] & Chr(34))

Richard Hollenbeck wrote:

I think it is the GROUP BY not being equal to anything. I want totals of
all grades from each student. I don't know what to make studentID equal to
(studentID=studentID? Of course not).

=(SELECT Sum([qryCourseGradeDistribution].[current average]) FROM
[qryCourseGradeDistribution] GROUP BY
[qryCourseGradeDistribution].[student])

How can I get around this problem? The text box DOES HAVE a unique name
prefixed with"txt".
Thanks.
RH

  #3  
Old October 2nd, 2004, 10:38 AM
Richard Hollenbeck
external usenet poster
 
Posts: n/a
Default

Thank you, John, for your reply. I need to make a few clarifications.
First, the query under discussion is the StrSQL string in a DAO.RecordSet.
I assign these RecordSets to text boxes all the time. Second, I'm not
trying to add up averages--that would be counter-productive. I probably
misnamed the field. It was actually the calculated/weighted score of an
activity (score*activityWeight*groupWeight). I know I did it wrong. I
probably needed to use a DCount(), in some way, instead. Here's the deal:

I need to add all [current averages] from each student in a course to get
the current grade for that student. I think I should change the name of
[current average] to properly identify it as the weighted score of a
weighted activity inside a weighted group of activities. After that, I
already have a report that does that. For this report, I don't need
individual student names, but the number of students whose scores are higher
than a certain number (92 for example) and increment the total of students
currently receiving the grade of A. Then =82 and 92 would be B, =72 and
82 would be C, etc. I will eventually want to build a bar chart on the
results, indicating a grade distribution for the entire class.

Sorry, John, that my original post was unclear. I think my original
thinking wasn't clear either. I still don't understand the GROUP BY thing
very well. I'd like to be able to group by a field rather than an
expression, and make sums without the constraints required. I am getting a
lot of errors about an expression not being part of some aggregate thing.
Certainly I need to learn a lot more about aggregated queries.

I Need the sum of (what is currently called) [Current Average] by student
and by course where course is the current course. This will give the
student's current semester grade.

Then, all I really need, is the number of them that fall within A,B,C,D, and
F ranges.


"John Spencer (MVP)" wrote in message
...
You can't assign a query to a text box control. You can use the DSUM

function
(although I do wonder about summing averages).

=DSum("[current average]","[qryCourseGradeDistribution]", "Student=" &

[Student])

You may get errors on that depending on whether Student is a number or

text
value and whether or not your qryCourseGradeDistribution has any

parameters.

If Student is a text value then try
=DSum("[current average]","[qryCourseGradeDistribution]", "Student="

Chr(34) &
[Student] & Chr(34))

Richard Hollenbeck wrote:

I think it is the GROUP BY not being equal to anything. I want totals

of
all grades from each student. I don't know what to make studentID equal

to
(studentID=studentID? Of course not).

=(SELECT Sum([qryCourseGradeDistribution].[current average]) FROM
[qryCourseGradeDistribution] GROUP BY
[qryCourseGradeDistribution].[student])

How can I get around this problem? The text box DOES HAVE a unique name
prefixed with"txt".
Thanks.
RH



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help on changing text size Luke Sineath Page Layout 7 June 11th, 2004 05:53 AM
Column separator crosses through wrapped text box Bob S Page Layout 0 April 25th, 2004 09:52 PM
Extracting text Nemo Worksheet Functions 3 April 6th, 2004 02:33 PM
Text boxes Tushar Mehta Charts and Charting 3 January 23rd, 2004 10:58 PM


All times are GMT +1. The time now is 10:03 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.