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!

Get Date Difference

Status
Not open for further replies.

Munimji

Technical User
Oct 15, 2004
1
US
Hi

I am pulling up a report to get login and Log out times and want to get the time spent on the helpdesk.These time are recorded in the database as different records.I have a field LOGID to define if the time specified in LOGTIME is login or logout time.Now how can I get the time spent on the helpdesk on a particular day & how many times person logged in and out.

LOGTIME LOGID
10/4/04 11:34 AM Login
10/4/04 11:44 AM Login
10/4/04 11:51 AM Login
10/15/04 11:13 AM Login
10/4/04 11:52 AM Logout
10/15/04 11:18 AM Logout.

Please help, Any help is much appreciated.

Thanks,


 
Can you give an example of the desired output please. Do you want the difference in days and hours/minutes or just days?

Also, do you want this to be cumulative for any given days or for all those logged in or for individuals logged in?

James
 
You could group by day, and then use running totals or to get the number of log-ins - use a formula test.

If you use running totals, they are working out at the same time as the Crystal report formats the line. This means you can show them in the group footer but not the group header, where they will be zero if you are resetting them for each group.
If you use summary totals, they are taken directly from the data and can be shown in the header. They can also be used to sort groups, or to suppress them.
To get a running total, right click and choose Insert and Running Total. If you want to get the summary totals for a database field, choose Summary instead.

As for amounts of time spent, you'll need to compair two different record, which isn't what Crystal is best at. But if you sort the transactions by time of day, the Previous or Next should let you find the difference using DateDiff, which includes time. I am assuming that everyone logs in and out on the same day.

It helps to give your Crystal version, since newer versions have extra options, and some extra problems. I use Crystal 8.5.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top