Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a range of Numbers from a Field

Status
Not open for further replies.

gabber4858

Technical User
May 27, 2008
95
US
I'm new to Access and trying to figure out how to make a query to get a number range from my table. My Table is set up like this:

Pair: Location 1:
1 2-Q28
2 2-Q28
3 2-Q28
4 8-W23
5 8-W23
6 2-Q28

I want to be able to search by "location 1" and have it output the ranges 1-3 6-XX. I have multiple locations too.

Is it possible to set up a query for this, or is there a better way to make the table? I also need to be able to search by the individual pair.

Thanks in advance!
 
You explanation is not very clear. I have no idea what you are really trying to do. But I assume your asking for the contiguous records of location 1 value of 2-Q2B. This value appears in pair 1 to 3 then in pair 6 to ... You will have to explain this a little better.

If that is what you want, then you might be able to do it in SQL but I think it would be much easier (at least for me) to do it using a recordset. Basically read through the recordset until you find your desired value(2-Q2B). Get the pair. Keep reading until the value changes and get the pair. Do that until the end of the recordset.

Provide a better explanation and should be able to provide the code if you want to pursue that approach.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top