hi Adeboyejo
I think Duane is assuming this is real data, in which case, grades on exams would be related to records in another table with the students who got them. Is this a school assignment? If so, we are happy to guide you, but we won't do your assignments.
have an awesome day,
crystal
Ade,
Something like this might work but I don't see either a primary key or something resembling a student ID number.
SELECT [STUDENT EXAM NO], SUBJECT, MARKSFROM [EXAMINATION RECORDS]WHERE MARKS IN�(SELECT TOP 5 MARKS��FROM [EXAMINATION RECORDS] ER�WHERE ER.[STUDENT EXAM NO] = [EXAMINATION RECORDS].[STUDENT EXAM NO]�AND SUBJECT <> "MATHS"�ORDER BY MARKS DESC, SUBJECT)OR SUBJECT = "MATH";
Again, please type []s around object names that contain spaces or symbols.
Thanks,Duane
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of Adeboyejo Oyenuga aoye_99@yahoo.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Friday, March 23, 2018 2:15 PM
To: Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals]
Subject: Re: [MS_AccessPros] Re: BEST SIX SUBJECTS�
I put the data in the form you prefer. Table name is EXAMINATION RECORDS and the three fields shown previously are the most relevant to the issue at hand.
Is there more clarity now ?
Ade
On Friday, 23 March 2018, 19:02:26 GMT, Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
�Ade,
I'm confused by your previous remarks "i know you do not like the excel format of tabulation' which I assume is my normal soap box regarding normalizing table structures while your current email suggests the table seems normalized.
So you have a table named [pls see below] with only three fields: [STUDENT EXAM NO], SUBJECT, and MARKS? (sorry, it is Friday afternoon)
Notice how I have taken the time to wrap any field name with spaces in []s for clarity.�
Regards,
Duane
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of Adeboyejo Oyenuga aoye_99@yahoo.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Friday, March 23, 2018 1:31 PM
To: Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals]
Subject: Re: [MS_AccessPros] Re: BEST SIX SUBJECTS�
OK.
pls see below
STUDENT EXAM NO SUBJECT MARKS 1 Maths 70 1 English 85 1 Science 81 1 History 90 1 Chemistry 64 1 Biology 91 1 Agric 72 1 Physics 50 1 Music 68 1 Greek 72
On Friday, 23 March 2018, 18:20:54 GMT, Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
�Ade,
Again "Can you provide actual table and field names?"
Duane
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of Adeboyejo Oyenuga aoye_99@yahoo.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Friday, March 23, 2018 11:00 AM
To: Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals]
Subject: Re: [MS_AccessPros] Re: BEST SIX SUBJECTS�
Thanks Duane,
i know you do not like the excel format of tabulation but its easy for me and so I am showing the data here. I have changed i field to make a tie. Really a tie does not make a difference in this case as it leaves the calculation unchanged at 489marks. If there is a tie at higher marks, this only displaces the lower marks that would have been included.
Ade
Please note also that a student can offer anything from 6 to 12 subjects but the best six are counted.
Exam No Maths English Science History Chemistry Biology Agric Physics Music Greek 1 70 85 81 90 64 91 72 50 68 72
On Friday, 23 March 2018, 15:33:17 GMT, Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
�Hi Ade,
Is there a StudentID in your table/query? I assume you would like a query that returns for each student their math mark as well as their top five subjects by mark excluding math.�
How would you handle ties?
Can you provide actual table and field names?
Here is a query from the Northwind Orders table that displays the top 3 orders for each customer by Freight:
SELECT Orders.CustomerID, Orders.OrderDate, Orders.FreightFROM OrdersWHERE (((Orders.OrderDate) In (SELECT TOP 3 O.OrderDate FROM Orders O where O.CustomerID = Orders.CustomerID ORDER BY O.OrderDate DESC )))ORDER BY Orders.CustomerID, Orders.OrderDate DESC;
Regards,
Duane
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of Adeboyejo Oyenuga aoye_99@yahoo.co.uk [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Friday, March 23, 2018 10:08 AM
To: wrmosca@comcast.net [MS_Access_Professionals]
Subject: Re: [MS_AccessPros] Re: BEST SIX SUBJECTS�
Thanks Bill. Scores in Maths must be in regardless of the marks obtained. The others are the highest marks in five subjects among the remaining subjects.
Ade
On Friday, 23 March 2018, 14:54:35 GMT, wrmosca@comcast.net [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
�Ade - what determines the 6 "best" subjects?
Regards,Bill Mosca, Founder - MS_Access_ProfessionalsMy nothing-to-do-with-Access blog
---In MS_Access_Professionals@yahoogroups.com, <aoye_99@yahoo.co.uk> wrote :
Hi all,
the data below is hypothetical results of a student for simplicity in a situation where there are thousands of students who study varying number of subjects, with Maths being compulsory.
Would you know of a function that will help calculate the total marks in six best subjects ?
Thanks.
Ade
S/NO SUBJECT MARKS
1 Maths 70
2 English 85
3 Science 81
4 History 90
5 Chemistry 64
6 Biology 91
7 Agric 72
8 Physics 50
9 Music 68
10 Greek 59
Sum of Best Six Marks 489
�
Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (11) |
Tidak ada komentar:
Posting Komentar