Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

If statement in Classic ASP

Posted on 2015-01-23
4
Medium Priority
?
203 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 400 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 1600 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

670 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