Search numbers from range in another database

2 posts / 0 new
Last post
Avinash
Offline
Joined: 12/13/2018 - 02:12
Search numbers from range in another database

Hi
Please help
 
I have 2 tables
1st table contains value (e.g. 2, 8, 13, 17, 55, 104,)
2nd table contains 3 columns. 1st Column Start range, 2nd column End range, 3rd Column value)
I want to build a query, where second column will be added in 1st Table.....which will contain criteria and will query the value in 1st table and check the value betwene Start and End range of 2nd table...if the value is between the start and end range...then it will give the corresponding value in 3rd column of 2nd table.
E.g.
1st Table
Value
2
8
13
17
55
104
276
2nd Table
Start End Value
4 10  A
12 18 B
20 30 C
52 87 D
90 124 E
 
Result should be:
1st Table
Value Result
2 Not found
8 A
13 B
17 B
55 D
104 E
276 not found
 

scotchy33
Offline
Joined: 09/05/2012 - 15:51

Attached script might do what you are looking for.
Scott