- Local time
- Today, 01:28
- Joined
- Jan 17, 2013
- Messages
- 14
Hi, I have a data where I want to create a query fulfilling the below conditions. Suppose I have two table: Table 1 and Table 2 If a value ex.98 (Table1) matches with the value with 98(Table 2),it should pick up my second higher value 103. suppose 103 is the next high value of 98 . Please see the data value. misprepaid.asm value from Table2 Required Result Con 98 98 98 then 103 if value of table1=98 then 103from table 2 (next large number) 103 103 103 then 149 if value of table1=103 then 149from table 2 (next large number) 149 149 149 then 175 if value of table1=149 then 175from table 2 (next large number) 175 175 175 then 198 if value of table1=175 then 198from table 2 (next large number) 198 198 198 then 199 if value of table1=198 then 199from table 2 (next large number) 199 199 199 then 201 if value of table1=199 then 201from table 2 (next large number) 201 201 201 then 245 if value of table1=201 then 245from table 2 (next large number) 245 245 245 then 251 if value of table1=245 then 251from table 2 (next large number) 251 251 251 then 351 if value of table1=251 then 351from table 2 (next large number) 351 351 351 then 352 if value of table1=351 then 352from table 2 (next large number) 352 352 352 then 451 if value of table1=352 then 451from table 2 (next large number) 451 451 451 then 499 if value of table1=451 then 499from table 2 (next large number) 499 499 499 then 598 if value of table1=499 then 598from table 2 (next large number) 598 598 598 then 599 if value of table1=598 then 599from table 2 (next large number) 599 599 599 then 601 if value of table1=599 then 601from table 2 (next large number) 601 601 601 then 751 if value of table1=601 then 751from table 2 (next large number) 751 751 751 then 851 if value of table1=751 then 851from table 2 (next large number) 851 851 851 then 949 if value of table1=851 then 949from table 2 (next large number) 949 949 949 then 951 if value of table1=949 then 951from table 2 (next large number) 951 951 951 then 1251 if value of table1=951 then 1251from table 2 (next large number) 1251 1251 1251 then 1501 if value of table1=1251 then 1501from table 2 (next large number) 1501 1501 1501 then 1501 if value of table1=1501 then 1501from table 2 (next large number)