Joined: 13 Dec 2012
Location: United Kingdom
Online Status: Offline
Posts: 5
Topic: getting number ranges with start and end numbers Posted: 29 Oct 2014 at 6:03am
Hi
I have a database with thousands of serial numbers which are not necessarily continuous as they are withdrawn for use e.g. 1-50, then 55-456, then 769-999
What I'm trying to do is produce a report showing, line by line the serial numbers in the various ranges. So, using the data above as an example I need the result to look like this
Row No Start Serial End Serial
1 1 50
2 55 456
3 769 999
etc.......
Joined: 13 Dec 2012
Location: United Kingdom
Online Status: Offline
Posts: 5
Posted: 29 Oct 2014 at 6:23am
The source table is a serial number table containing many thousands of records in serial number sequence. As these serial numbers get used (not necessarily in sequence) they are allocated a code (dozens of different codes depending on type of use) to show that they are in use, leaving the remaining records which have not yet been issued.
The trouble is the unused serial numbers won't always be in sequence so there could be unused (serial) numbers 1-50 in sequence, then a range of numbers that have been used, followed again by another range of unused numbers.
It's the blocks of unused numbers that I need to identify by getting the first number of the block and the last number of the block and presenting those two numbers in one row on the report etc. Hope that helps to clarify
Joined: 13 Dec 2012
Location: United Kingdom
Online Status: Offline
Posts: 5
Posted: 29 Oct 2014 at 6:26am
Praveen
Thanks for your reply
Unfortunately the serial numbers are only in one field (see my other reply), so I need to find a way of identifying the start and end numbers of blocks of numbers that haven't been used. The only thing I can think of that may help is that all of the unused records have a control key field of either null or zero
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum