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

Counting a Time Variance formula

Status
Not open for further replies.

Oustasu

Technical User
Jul 6, 2009
3
US
I am trying to create a formula to count each occurrence of a variance in time plus or minus 10 seconds. What I am trying to do is to count the Resolved items that are plus or minus 10 seconds from the Create Date.

Crystal Reports XI
Data Source - CSV
Time format - "6/28/2009 8:05:30 AM"

Basically I would like to count:
Create Date = "6/28/2009 8:05:30 AM" Resolved = "6/28/2009 8:05:39 AM"
or
Create Date = "6/28/2009 8:05:30 AM" Resolved = "6/28/2009 8:05:25 AM"

But not count
Create Date = "6/28/2009 8:05:30 AM" Resolved = "6/28/2009 8:05:41 AM"
or
Create Date = "6/28/2009 8:05:30 AM" Resolved = "6/28/2009 8:05:15 AM"


I know, don't ask me how something can be resolved before it is created, but we see it happen occasionally in the system.

I was not able to get the following to return results for me (as suggested by IanWaterman in another forum section):
datediff("s", datetime1, datetime2)

Thank you in advance,
David
 
If it is a string field, then use:

if abs(datediff("s",datetime({table.createdate}),datetime({table.resolved}))) <= 10 then 1

Place this in the detail section and insert a summary (sum, not count) on it.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top