sql computed column formula syntax help
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 UNKOWN
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
Re: sql computed column formula syntax help
Well, this is more of a MySQL question and I am assuming you want an SQL query to do it for you but...
SELECT IF(GRADE IS NULL, 'UNKNOWN', IF(GRADE>=4,'FAILED','PASSED')) AS Grade, Remarks
FROM MyTable.
Now if this is homework, and you need this done in VB.Net code, then show us your code so we can see what you have.