For Programmers: Free Programming Magazines  


Home > Archive > Association of Shareware Professionals forum > May 2005 > Please help with IF statement problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Please help with IF statement problem
roger@mtbwales.co.uk

2005-05-16, 9:00 pm


Hi All,
New to the group. Having difficulty with Greater AND Less than.

This is my code and I am trying to get greater than 100 AND less than 200 to
work.

<% if (Recordset1_total) > "100" AND (Recordset1_total) < "200" then %><img
src="images/silver.jpg"><% end if %>


Any ideas??

Many thanks!


bill@nalens.com

2005-05-17, 4:01 am


roger@mtbwales.co.uk wrote:
> Hi All,
> New to the group. Having difficulty with Greater AND Less than.
>
> This is my code and I am trying to get greater than 100 AND less than 200 to
> work.
>
> <% if (Recordset1_total) > "100" AND (Recordset1_total) < "200" then %><img
> src="images/silver.jpg"><% end if %>
>
>
> Any ideas??
>
> Many thanks!
>
>


Looks like ASP code to me. If that is correct, you can try using the
cint or clng functions like so
cint(Recordset1_total) > 100 and cint(recordset1_total) < 200

if indeed the recordset totals are strings (which would be strange). You
really shouldn't have quotes around the numbers 100 and 200.

--
Bill Nalen
RedBog Software

http://www.gardenboss.com : Visual garden planner for Windows
http://www.redbog.com : WKrellM system monitor

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com