If statement in Classic ASP

Hi Experts,
I would like to add two more conditions to the following if statement:
<%If rs("LevelOfDiscipline")<>"Informal Conversation" Then%>
Besides "Informal Conversation" I would also like to add "Coaching" and "Counseling".
What is the correct format?

I tried
not in ("Informal Conversation", "Coaching", "Counseling")
but it didn't work.

Thank you for your help.
romsomAsked:
Who is Participating?
 
Big MontyConnect With a Mentor Senior Web Developer / CEO of ExchangeTree.org Commented:
Try

<%If rs("LevelOfDiscipline")<>"Informal Conversation" or rs("LevelOfDiscipline") = "Coaching" or rs("LevelOfDiscipline") = "Counseling"  Then%>
0
 
David LeeConnect With a Mentor Commented:
I recommend switching from an IF statement to a CASE statement.  Something like

<%
    Select Case rs("LevelOfDiscipline").value
        Case "Informal Conversation", "Coaching", "Counseling")
            'Your code goes here'
    End Select
%>

Open in new window

0
 
romsomAuthor Commented:
Thank you all.
DevilFan, I was trying to customize your solution, but unfortunately I couldn't do it.
0
 
David LeeCommented:
romsom,

There was a typo in the code.  There shouldn't have been a parenthesis at the end of line 3.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.