Re: Issue with Greater Than IF Statement

Re: Issue with Greater Than IF Statement

am 29.03.2007 05:39:37 von raj

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

If rs.Fields(2)>89 Then

"Nate" wrote in message
news:1175175926.154603.36740@n76g2000hsh.googlegroups.com...
> 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?
>

Issue with Greater Than IF Statement

am 29.03.2007 15:45:26 von 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?

Re: Issue with Greater Than IF Statement

am 29.03.2007 18:34:51 von exjxw.hannivoort

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]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)