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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

comparing date ranges from record to record 2

Status
Not open for further replies.

VE

Technical User
Oct 25, 2000
220
US
Each record has a "from" and a "to" date.

I want to write a report that will tell me if any of the date ranges overlap- basically, I need it to tell me if one item has been scheduled to be in two places at once...

Is that possible?

I've been staring at this too long :-\
 
Sort by the from date.

To determine if the next event From date < the current To date you can use:

{table.ToDate} < next({table.FromDate})

-k
 


Awesome! that was too easy!! Thank you!!!
 
You could try:

if {startdate} < previous({enddate}) then 1 else 0

Or you could use:

if {startdate} < previous({enddate}) then &quot;Overlap&quot; else &quot;No Overlap&quot;

-LB
 
That's really cool, I didn't know about next and previous, what are they under in the formula editor? I know they work when you type them, I'm just wondering what other cool stuff is in there with them :).
 
VE,

theres a lot of cool stuff in there, check it out.

A few notes on using previous() or Next()

The first record of a database will not have a previous value, nor will the last record have a next value. To keep an error from occurring at run time, precede the formula logic with one of the following statements:

Not OnFirstRecord
Not OnLastRecord

Also, forumla that use either of these 2 functions cannot be summarized. Usually not a big deal because you can get around that with variables.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
The previous and next (and other cool things) are under &quot;Print State&quot;

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top