Reputation:
I do have few lines of codes that consists of nested IF statements. But there's an error in it..I don't how to figure it out..hope anyone of you can help me to solve this problem..the codes as below..
<%
If rs.Fields.Item("StudentStatus").Value=""
If (rs.Fields.Item("CGPAOverall").Value>="2.00") Then %>
<strong><font color="#3300FF" size="-1" face="Arial, Helvetica, sans-serif">
You are QUALIFIED to go for competition
</font></strong>
<% Else %>
<strong><font color="#FF0000" size="-1" face="Arial, Helvetica, sans-serif">
You are NOT QUALIFIED to go for competition
</font></strong>
<%Else
If rs.Fields.Item("StudentStatus").Value="YES" then
response.write "APPROVED"
else
response.write "NOT APPROVED"
end if
End if
End If
%>
But when I compile the codes, the error is this..
Error Type: Microsoft VBScript compilation (0x800A03F9) Expected 'Then' /project2/check_status.asp, line 109, column 50 If rs.Fields.Item("StudentStatus").Value="" -------------------------------------------------^
Need your advice on how to correct this error..please help..thanks..
Upvotes: 0
Views: 4968
Reputation: 94653
IF RS.Fields("StudentStatus").Value="" Then
IF rs.Fields.Item("fieldname").Value>=2.00 Then
....
End if
Else If ....
....
Else
....
End IF
Upvotes: 4
Reputation: 3169
The error message contains the answer you are looking for:
Expected 'Then'
Add the 'then' where it expects it: /project2/check_status.asp, line 109, column 50
After that I would recommend reading Read error messages, understand them and write your own
Upvotes: 2