View Full Version : gap detection


yousif
03-16-2007, 11:59 PM
hi

i need your help

i am trying to query my data and find missing numbers or detect the gaps.

for Ex.

1258
1259
1261
1262
1269
1280

how to get those missing numbers by using a query?

thanks in advance

Moniker
03-17-2007, 12:22 AM
A single query won't be able do to this. While you could get a combination of queries to do it, it's actually a lot easier to do something like that in Excel. In Excel, it would look like this:


Row Column A Column B Formula Column B Result
2 1258
3 1259 =A3-A2 1
4 1261 =A4-A3 2
5 1262 =A5-A4 1
6 1269 =A6-A5 7
7 1280 =A7-A6 11


Everytimes the result of column B doesn't equal 1, you've got a gap between that row and the previous row.