Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Issue with Greater Than IF Statement

Reply
Thread Tools

Issue with Greater Than IF Statement

 
 
Raj
Guest
Posts: n/a
 
      03-29-2007
Since rs.Fields(2) is numeric you should rewrite the condition like:

If rs.Fields(2)>89 Then

"Nate" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.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?
>



 
Reply With Quote
 
 
 
 
Nate
Guest
Posts: n/a
 
      03-29-2007
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?

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      03-29-2007
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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Include header files in quotes or less-than greater-than signs? Dwight Army of Champions C++ 4 03-17-2010 06:39 PM
regex problem: 'greater than' 'less than' and 'equals' not matching! falcon Java 10 02-24-2006 01:23 PM
ServerVariables("LOGON_USER") reports a length greater than the characters displayed Ryan ASP .Net 1 01-19-2006 06:23 PM
Quotes, tags, and "greater than" signs danthman ASP .Net 2 12-23-2005 08:20 PM
Enforcing that value entered is greater than a specified value BobRoyAce ASP .Net 7 03-03-2005 05:05 PM



Advertisments