computed column formula HELP!

raokikun

Member
Joined
Aug 17, 2011
Messages
15
Programming Experience
Beginner
i got two columns in mysql 2005

Grade and Remarks

i need to do is.. when i input integers in grade column

1,1.25,1.50,1.75,2,2.25,2.50,2.75,3

then Remarks will show PASSED

and when Grade is 4 up

remarks will show FAILED

(OPTIONAL)----------------------
if Grade is null -
then Remarks will show UNKNOWN -
--------------------------------

this is my code but it doesnt works on sql computed column formula

IIF(Grade >=4, 'Failed', IIF(Grade IN (1,1.25,1.50,1.75,2,2.25,2.50,2.75,3), 'PASSED','UNKNOWN'))



can anyone revise my code into.. sql formula code?? thanks
 
Computed Column not working


the computed column REMARKS doesnt works?

i got no problem on creating the database and table
no problem on connecting it to the visual basic

but when executing

when i input GRADES
nothing happens to the REMARKS computed column

how can i do that.. help sir

i really need this for my thesis.. in order to graduate

HERE IS MY CODE IN SQL

create database ccs

create table student
(
P_Key int IDENTITY,
Student_Number varchar(50) NULL,
Grade decimal(10) NULL,
PRIMARY KEY (P_Key),
Remarks AS CASE WHEN Grade IS NULL THEN 'UNKNOWN'
WHEN Grade <4 THEN 'PASSED'
ELSE 'FAILED'
END
)



its just the same when i use the coding expression property in the dataset.. another kind of computed column but the problem is the same.. its not working but the code is fine no errors or exceptions

here is my query in sql..
 
Back
Top