If then statement not working

K

ken

I am trying to use the statement below but it is not picking up the first
condition. When severity1 = S1 and severity = "" I get Severity = "" instead
of severity=S1. I get the correct one if the severity is S2.
Is the format correct.
Thanks
Ken

if RSupdate("severity1")= "S1" and RSupdate("severity2")= "" then
Severity = "S1"
else if RSupdate("severity1")= "" and RSupdate("severity2")= "S2" then
Severity = "S2"
else severity=""
end if
 
B

Bob Barrows [MVP]

Response.Write is your friend - use it :) see below:
ken said:
I am trying to use the statement below but it is not picking up the
first condition. When severity1 = S1 and severity = "" I get Severity
= "" instead of severity=S1. I get the correct one if the severity is
S2.
Is the format correct.
Thanks
Ken

Response.Write "severity1 = """ & RSupdate("severity1") & """<BR>"
Response.Write "severity2 = """ & RSupdate("severity2") & "" said:
if RSupdate("severity1")= "S1" and RSupdate("severity2")= "" then

HTH,
Bob Barrows
 
P

PW

ken said:
if RSupdate("severity1")= "S1" and RSupdate("severity2")= "" then
Severity = "S1"
else if RSupdate("severity1")= "" and RSupdate("severity2")= "S2" then
Severity = "S2"
else severity=""
end if


How about this ...

Severity = RSupdate("severity1") & RSupdate("severity2")

This way Severity should end up being either "S1" or "S2" or "".

HTH,
PW
 
R

Roland Hall

in message : I am trying to use the statement below but it is not picking up the first
: condition. When severity1 = S1 and severity = "" I get Severity = ""
instead
: of severity=S1. I get the correct one if the severity is S2.
: Is the format correct.
: Thanks
: Ken
:
: if RSupdate("severity1")= "S1" and RSupdate("severity2")= "" then
: Severity = "S1"
: else if RSupdate("severity1")= "" and RSupdate("severity2")= "S2" then
: Severity = "S2"
: else severity=""
: end if

Perhaps it is because you are using 'else if' and not 'elseif' as one word?!

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top