For the Case statement to calculate the mark try the following
Sum ( Results::Marks ) > 80 ; "Distinction" ;
Sum ( Results::Marks ) > 40 ; "Pass" ;
Sum ( Results::Marks ) < 40 ; "Fail" ;
No sure how you need the Supplementary field to affect the mark, but if you give me more details I can work it into the above for you.
I hope this helps
And, Sidhu, If the mark is exactly 40? In Orlando's calc it would produce blank. Is that what you want? And if < 40 and > 80 and > 40 is accounted for, there would be no need for default result unless the poor 40 person is supposed to be there because ALL other results are accounted for.
Might one of those 40's be 'less than or equal to' and skip the default result of blank, which isn't required in Case() anyway because default result produces null by itself. :smileyhappy:
Thanks for your time,
The reason for supplementary feild is, if a student is making 2nd attempt, then the user will check supplementary feild in Results table. and i have another feild in Students table for supple, which will calculate the sum when there is value in supplementary in Results table.
field Supple =
In Results table each student ID will have 3 records in i.e. (Test, LAB, Quiz) and i want to add all these marks.
So depending on the values in supplementary (Which is 1 or "") i want the feilds in Students to sum up the marks.
So if the Student writes the exam twice, first time i want to sum up the values in marks feild, and put that value in Final field in Students,
for the 2nd attempt i want to sum up the value in marks feild and put that value in Supple field in Students.
You need a calculation field in the Results table, =Case ( Isempty ( Supplementary), marks )
Then, sum this field in Students, applying your conditions:
Let ($grade = Sum ( Results::cn_marks ), Case ( $grade < 40, "Fail", $grade < 80, "Pass", "Distinction" ) )