Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

test for consecutive numbers 1

Status
Not open for further replies.

Mikele

Technical User
Jun 5, 2001
3
DE
in a single database table I wish to test a single field for consecutive numbers and report (print) the missing entries. i.e table contains:- 11, 12, 14, 16, 17
the report would print 13, 15

cheers
 
Here is a simple technique that does what you want. It identifies the gaps in a sequence and shows the width of the gap. If three consecutive records are missing it will print the first and last ones missing:

Create 2 formulas called PrintFrom and PrintTo:

PrintFrom: {field} + 1
PrintTwo: Next ({field}) - 1

Put these on the detail band with the word "to" between them.

Now, suppress you details with the following condition:

{PrintFrom} = Next ( {field} ) Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Thanks Ken
That was V useful, Just wondering if you could expand it slightly to allow me to print the range of missing entries (if applicable) i.e

Missing entries are:-
1
7
8
9
16
21

anyway
cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top