Print Page | Close Window

Need help with more and less range filtering of a

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=23588
Printed Date: 28 March 2026 at 11:07pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Need help with more and less range filtering of a
Posted By: Bebopgeo
Subject: Need help with more and less range filtering of a
Date Posted: 22 June 2007 at 4:05pm
I have a record set that has 20 sites listed in it. They start at 1 and go to 20. I'm filter them by a MMColParam in MsAccess using .ASP. When I give a 10 for the search param I wood like my search to bring back a range of two less then then 10 and two more then 10 and included 10 so I wood get back 8,9,10,11,12 from the database. So how can I do that?



Replies:
Posted By: michael
Date Posted: 22 June 2007 at 5:26pm
Not knowing the structure of your table here just a rough cut.

Select * from yourtable where siteID between (@param - 2) AND (@param +2)
 
Access is weird with () so you may have to play with those.


-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Bebopgeo
Date Posted: 22 June 2007 at 6:15pm
Smile That worked perfect think you! think you! think you! Michael



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