If then statement not working

Discussion in 'ASP General' started by ken, Apr 8, 2004.

  1. ken

    ken Guest

    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
    ken, Apr 8, 2004
    #1
    1. Advertising

  2. Response.Write is your friend - use it :) see below:
    ken wrote:
    > 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") & """<BR>"

    > if RSupdate("severity1")= "S1" and RSupdate("severity2")= "" then


    HTH,
    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Apr 8, 2004
    #2
    1. Advertising

  3. ken

    PW Guest

    "ken" <klsloan@ingr_Spam.com> wrote in message
    news:...
    > 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
    PW, Apr 9, 2004
    #3
  4. ken

    Roland Hall Guest

    "ken" wrote in message news:...
    : 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
    Roland Hall, Apr 9, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWlrZQ==?=

    greater then / less then

    =?Utf-8?B?TWlrZQ==?=, Nov 4, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,573
    Kevin Spencer
    Nov 4, 2004
  2. JosephByrns

    Slow, then quick then slow

    JosephByrns, Jul 10, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    2,476
    codezilla94
    Nov 13, 2007
  3. Mufasa
    Replies:
    7
    Views:
    407
    Alexey Smirnov
    Sep 4, 2007
  4. Aaron [SQL Server MVP]

    "If valueDB = valueQS then" statement not working

    Aaron [SQL Server MVP], Aug 2, 2004, in forum: ASP General
    Replies:
    2
    Views:
    108
    Chris Tilley - HPC:Factor
    Aug 2, 2004
  5. Replies:
    0
    Views:
    261
Loading...

Share This Page