Make Query From Three Fields and make a New Field (1 Viewer)

rpraveen6r

New member
Local time
Tomorrow, 02:25
Joined
Sep 7, 2015
Messages
1
Hi Sir...

I am new to MS Access. I am entrusted with a project in my office. The project table has three fields 'Theory Total', 'Practical Total' and 'Grand Total'. My requirement is query should look into these fields and say that if 'Theory Total' is less than 60% marks then it should say 'Failed in Theory'. Same way to 'Practical Total'. If any body score more than 80% in 'Grand Total' then it should say 'Pass' otherwise 'Fail'

___________________________________________________________
Theory Total Practical Total Grand Total Result
--------------------------------------------------------------------
45 Failed in Theory
72 67 Failed in Practic
72 85 81 Pass
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:55
Joined
May 7, 2009
Messages
19,246
SELECT IIf([Theory Total]<60,Format([Theory Total],"@@@") & " Failed in Theory",IIf([Practical Total]<60,Format([Theory Total],"@@@") & " " & Format([Practical Total],"@@@") & " Failed in Practical",IIf([Grand Total]<80,Format([Theory Total],"@@@") & " " & Format([Practical Total],"@@@") & " " & Format([Grand Total],"@@@") & " Failed",Format([Theory Total],"@@@") & " " & Format([Practical Total],"@@@") & " " & Format([Grand Total],"@@@") & " Passed"))) AS [Total Result]
FROM tblTheoryTotal;
 
Last edited:

Users who are viewing this thread

Top Bottom