Solved

If statement in Classic ASP

Posted on 2015-01-23
4
191 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
  • 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 32

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now