"Arno R" <ar***********@tiscali.nl> wrote in
news:42*********************@dreader2.news.tiscali .nl:
I need to find the 'gaps' in a numbered recordset like:
1 Philips
2 Jones
5 Jo Do
6 Frenzy
10 John Matthias
23 Arno R (and so on ....)
What I need is one blank line (or a line that says: " ... gap here
..." ) everytime a gap is found like: 1 Mr. Philips
2 Mrs. Jones
5 Jo Do
6 Frenzy
10 John Matthias
23 Arno R
What would be the most simple way to achieve this ?
I can do it by creating or using a temptable, but can it be done
without the temptable?
Thanks
Arno R
Well, if you do this in a report, then...
select md.*, md1.id, md1.id as next_id
from MyData as MD left join MyData as MD1 on
md.id = (md1.id-1)
That should give you this set:
id, name, next_id
1, ..., 2
2, ..., <null>
5, ...., 6
6, ..., <null>
10,..., <null>
15
....and so on.
In a report, then, you want to add another control BELOW like this:
[detail=========================]
<id > <name ><nextid >
<nullplaceholder>
The <nullplaceholder> control should be a Text box that is bound to this
function: =iif(isnull([nextid]), " ", null), and set the CanGrow and
CanShrink properties.
This way, you don't have to do any funky formatting in the OnFormat event
handler for the Detail section.