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

Time Diff

Status
Not open for further replies.

kmcclung

Programmer
Nov 20, 2001
120
US
I am attempting to create a login/logout report and am stumped.

It looks like this so far...
Login Date/Time Logout Date/Time Diff
(mins)
11/11 11:10:35am 11/11 12:59:49pm 109
11/11 1:20:46pm 11/11 3:00:16pm 100

This works great. However, what I haven't been able to figure out is how to get the difference between the logout time and the next login time (ie. 11/11 12:59:49pm to 11/11 1:20:46pm)

Any ideas?
 
Try this:
//get the login date of the next record
DateTimeVar nextLogin := Next({tableNm.NextStartDateField});

//get the Date diff between the logout date of this record and nextLogin
NumberVar myDateDiff := DateDiff("intervalType",LogoutDate, nextLogin);

myDateDiff
 
...and of course, your records will have to be ordered by date.
 
I m using Crystal Reports 7,
I m on a report for calculating the diff between two times
but cannot use a function cdate and/or datediff but its not working,
The date field is in the string format.
Pleas help.
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top