Reputation: 181
I would like to create a column that displays if a student has passed or failed. To pass the overall grade needs to be above 40.
I have done this before using access using the following:
IIf([Overall]<=40,"fail","pass")
But I’m very new to visual basic. Anyone got any ideas on how I can do this?
The IDE I am using is Visual Studio
This is the table
Or if there are any tutorials that you would recommend that would be great.
Upvotes: 2
Views: 361
Reputation: 125197
You can do it in your table definition:
CASE WHEN
statement to check for a criteria and provide a value. So you can add a column like this:
[ColumnName] AS CASE WHEN (the formula for overall) <= 40 THEN 'fail' ELSE 'pass' END
Also you can make the result as a bit
(boolean) data type and let the application decide to show a string instead of true or false.
Upvotes: 3