range based query

  • Thread starter Thread starter siddharth
  • Start date Start date
S

siddharth

Guest
i need help designing a query in MS Access. i'll go straight into the nature of the problem and ask my questions subsequently.

i have this DB with one particular field named POWER. The columns under this feild are integers. I need to design a query that will return me the range in which a particular number lies. say, if i look for 320 then the query should return the records that match 320. in the event that there is no match, then the query should return, the closest upper limit and lower limit from the existing enitities (like 345 and 312) I was wondering if this could be done. If yes, could somebody explain to me how i can create a query to this end.
 
use the BETWEEN and AND words in your criteria row i.e.

Between YourNumber And YourNumber
 
hmmm...

that assumes that i know the lower and upper limit. In this case I do not know the limits to use BETWEEN and AND. What could be a possible solution
 
you can use a parameter query, where at run time you will be prompted to enter your upper and lower number.

thus in your criteria you should put:

Between [Enter Your Lower Number] And [Enter Your Upper Number]

when you run this query, you will get prompted to enter the numbers.
 

Users who are viewing this thread

Back
Top Bottom