I have a customer lookup screen. We set it up to select max 500 records from anywhere in the table. If the user includes some text for searching though, we select the 250 before and the 250 after the search phrase. Here is an example:
If for instance the records before the first instance of FR would be:
Rec 400: Example98
Rec 401: Example99
Rec 402: Free1
Rec 403: Free2
But the result I got was not what I was looking for. I do not receive the 4 records in my results. I get records 1-250 and records 402 to 651.
What I want is records 151-651. Any ideas?
My thoughts are a union isnt going to work for what i need, I may need to make 2 separate calls.
Code:
SELECT TOP 250 Item,Description FROM Inventory WHERE Item <= FR
UNION
SELECT TOP 250 Item,Description FROM Inventory WHERE Item >= FR ORDER BY Item
If for instance the records before the first instance of FR would be:
Rec 400: Example98
Rec 401: Example99
Rec 402: Free1
Rec 403: Free2
But the result I got was not what I was looking for. I do not receive the 4 records in my results. I get records 1-250 and records 402 to 651.
What I want is records 151-651. Any ideas?
My thoughts are a union isnt going to work for what i need, I may need to make 2 separate calls.