Print Page | Close Window

Display Gaps in Sequence based on range

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22664
Printed Date: 28 Apr 2024 at 1:03pm


Topic: Display Gaps in Sequence based on range
Posted By: ridershaun
Subject: Display Gaps in Sequence based on range
Date Posted: 30 Aug 2018 at 3:43am
I have two fields in a table with a starting number and ending number and I want to find each value between. I then want to compare it to another field and only display the missing values.

Example: (table name and field)
Start Range: 4000 (POEX.start)
End Range: 4999 (POEX.end)
Purchase Orders in Use: 4000, 4001, 4002 (PO.NUM)
Results: 4003, 4004, ect..

Any help would be appreciated.
Thanks



Replies:
Posted By: DBlank
Date Posted: 31 Aug 2018 at 3:06am
best case scenario is you have a table that has a row for each number. from there you can do outer joins to get the result row per number which will be easier to use. Or you can create a temp table with the values using a stored procedure (or its equivalent depending on your data source)



Print Page | Close Window