Print Page | Close Window

If Statements w/ Numbers

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=6435
Printed Date: 31 March 2026 at 3:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: If Statements w/ Numbers
Posted By: k_mustard
Subject: If Statements w/ Numbers
Date Posted: 15 October 2003 at 10:16am

Ok here is question 2, I want to display the records from between 400000-500000 also the records between 40000000-50000000. My reason for this is because all the records between these numbers are from the same work order and must have a different instance occur when called upon in a form.

<%IF strSQL("Unit_Status")="WFP" AND ((strSQL("Record")=400000>500000 OR strSQL("Record")=40000000>50000000))THEN%>

So this isnt exactly working...what should i use instead?? or change?




Replies:
Posted By: MorningZ
Date Posted: 15 October 2003 at 10:44am

"strSQL("Record")=400000>500000" 

is totally not valid that's why it don't work

you'll have to do like:

IF strSQL("Unit_Status")="WFP" AND ((strSQL("Record") >=400000 AND strSQL("Record")<=500000) OR (strSQL("Record")>=40000000 AND strSQL("Record")<=50000000))THEN

not sure where you are learning ASP syntax from, but find a new source! :-)



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: k_mustard
Date Posted: 15 October 2003 at 10:51am

lol..yea ive just been trying trial and error....maybe i should learn before i try that

 



Posted By: k_mustard
Date Posted: 15 October 2003 at 10:52am
btw..thanks for your help..that works great


Posted By: MorningZ
Date Posted: 15 October 2003 at 10:59am

i forgot to mention:

are these records in the range of 400000 to 500000 (and the other range) the only ones you will be using?

because if so, it'd make a lot more sense to use those ranges as criteria in your SQL statement, then you don't need any if..then's in your ASP script



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: k_mustard
Date Posted: 15 October 2003 at 11:01am
No...i need all the other records as well..so this will work fine



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net