Solved

If statement in Classic ASP

Posted on 2015-01-23
4
201 Views
Last Modified: 2015-01-23
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.
0
Comment
Question by:romsom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 76

Assisted Solution

by:David Lee
David Lee earned 100 total points
ID: 40567071
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
 
LVL 33

Accepted Solution

by:
Big Monty earned 400 total points
ID: 40567084
Try

<%If rs("LevelOfDiscipline")<>"Informal Conversation" or rs("LevelOfDiscipline") = "Coaching" or rs("LevelOfDiscipline") = "Counseling"  Then%>
0
 

Author Closing Comment

by:romsom
ID: 40567246
Thank you all.
DevilFan, I was trying to customize your solution, but unfortunately I couldn't do it.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 40567609
romsom,

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

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question