Issue with Greater Than IF Statement

R

Raj

Since rs.Fields(2) is numeric you should rewrite the condition like:

If rs.Fields(2)>89 Then
 
N

Nate

When using the following statement, I am encountering a problem:

<% If rs.Fields(0) = "Lead 30 Day" THEN %>
<% IF rs.Fields(2) > "89" THEN %>
Pass
<% ELSE %>
FAIL
<% END IF%>
<% End If %>

rs.Fields(2) is a numerical value, in this case 100. For some reason,
the page is still displaying "Fail" for the record, even though 100 is
obviously larger than 89.

Any ideas on why it would think 100 is less than 89?
 
E

Evertjan.

Nate wrote on 29 mrt 2007 in microsoft.public.inetserver.asp.general:
When using the following statement, I am encountering a problem:

<% If rs.Fields(0) = "Lead 30 Day" THEN %>
<% IF rs.Fields(2) > "89" THEN %>
Pass
<% ELSE %>
FAIL
<% END IF%>
<% End If %>

rs.Fields(2) is a numerical value, in this case 100. For some reason,
the page is still displaying "Fail" for the record, even though 100 is
obviously larger than 89.

Any ideas on why it would think 100 is less than 89?

"100" < "89"

because string:

"1" < "8"

because [ascii number values}:

49 < 56

[that is called string comparison]
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top