Syntax Error in IF statement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nate

    Syntax Error in IF statement

    I am trying to use the following IF statement, and whenever I use a
    single or double quote, I receive a syntax error. When using no
    quotes, the syntax is accepted, but the statement does not perform
    properly.

    ***The problem line***
    <% if violation_type= ''Tardy'' THEN %>
    ***rest of the statement***
    TARDY VIOLATIONS
    <% if rs2.Fields(0) = 0 THEN %>
    This is the first unexcused Tardy violation for this employee. A
    coaching is required. Click <A HREF=blah>HERE</Ato issue the
    coaching.
    <% ELSE %>
    This employee has <%response.writ e(rs2.Fields(0) )%previous
    violations.
    <% END IF %>
    <% ELSE %>
    The <%response.writ e(violation_typ e)%violation has been recorded.
    <% END IF %>

    Variables defined:
    violation_type = request.form("v iolation_type")

    Any ideas?

  • Anthony Jones

    #2
    Re: Syntax Error in IF statement


    "Nate" <nate.borland@w estecnow.comwro te in message
    news:1171722048 .402560.76860@l 53g2000cwa.goog legroups.com...
    I am trying to use the following IF statement, and whenever I use a
    single or double quote, I receive a syntax error. When using no
    quotes, the syntax is accepted, but the statement does not perform
    properly.
    >
    ***The problem line***
    <% if violation_type= ''Tardy'' THEN %>
    Are you saying the above line as it is generates a syntax error??


    Comment

    • Nate

      #3
      Re: Syntax Error in IF statement

      For some reason, it was. I loaded the code up into Source Edit and
      made some changes to other parts of the code, and suddenly it worked.
      I appreciate you taking the time to reply - must have been a fluke :-\

      On Feb 17, 8:31 am, "Anthony Jones" <A...@yadayaday ada.comwrote:
      "Nate" <nate.borl...@w estecnow.comwro te in message
      >
      news:1171722048 .402560.76860@l 53g2000cwa.goog legroups.com...
      >
      I am trying to use the following IF statement, and whenever I use a
      single or double quote, I receive a syntax error. When using no
      quotes, the syntax is accepted, but the statement does not perform
      properly.
      >
      ***The problem line***
      <% if violation_type= ''Tardy'' THEN %>
      >
      Are you saying the above line as it is generates a syntax error??

      Comment

      Working...