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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query parameters 1

Status
Not open for further replies.

stroyer74

IS-IT--Management
Jan 22, 2003
70
US
I'm struggling with how to write a query. I have a table with records that are identified by a section field and an ID field, but the SECTION and ID fields can be repeated. For example, these would be valid records

SECTION ID
1 2
1 7
2 1
2 2
2 3
2 8
2 9
2 10

If I want to query only records (1,7) through (2,9), what would my query be? If I
select * where (SECTION>=1 and ID>=7) and (SECTION<=2 and ID<=9)

that won't work. Obviously it would have been better to have the record IDs as a single field rather than two, but this was created many many years ago and changing that isn't an option at the moment.

Any ideas?
 
Thanks for the idea Duane! That works perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top