By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,786 Members | 2,241 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,786 IT Pros & Developers. It's quick & easy.

Syntax Error in IF statement

P: n/a
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.write(rs2.Fields(0))%previous
violations.
<% END IF %>
<% ELSE %>
The <%response.write(violation_type)%violation has been recorded.
<% END IF %>

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

Any ideas?

Feb 17 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Nate" <na**********@westecnow.comwrote in message
news:11*********************@l53g2000cwa.googlegro ups.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??
Feb 17 '07 #2

P: n/a
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...@yadayadayada.comwrote:
"Nate" <nate.borl...@westecnow.comwrote in message

news:11*********************@l53g2000cwa.googlegro ups.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??

Feb 17 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.