Solved

# Hours minutes and seconds left

Posted on 2011-03-10
Medium Priority
276 Views
I want to display the days, hours and minutes between two dates using a Crystal reports formula but am unsure on how to do this. Can this be done using either basic of Crystal syntax?
0
Question by:JayceW
1 Comment

LVL 101

Accepted Solution

mlmcc earned 2000 total points
ID: 35095865
It can be done in either syntax.  Here it is in Crystal

Local NumberVar TotalSeconds;
Local NumberVar HoursLeft;
Local NumberVar MinutesLeft;
Local NumberVar DaysLeft;

TotalSeconds := DateDiff('s',{StartDateTime},{EndDateTime});
DaysLeft := TotalSeconds \ (60*60*24);
TotalSeconds  := TotalSeconds mod (60*60*24);
HoursLeft := TotalSeconds \ (60 * 60);
TotalSeconds := TotalSeconds mod (60 * 60);
MinutesLeft := TotalSeconds \ 60;
TotalSeconds := TotalSeconds  mod 60;

CStr(DaysLeft ,0) & " days  " & CStr(HoursLeft ,0) & ":" & CStr(MinutesLeft,0) & ":" CStr(TotalSeconds  ,0)

mlmcc

0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…
If you are looking for an automated solution for backup single or multiple Office 365 user mailboxes to Outlook data file, then you can use Kernel Office 365 Backup & Restore tool. Go through the video to check out the steps to backup single or mult…
###### Suggested Courses
Course of the Month6 days, 14 hours left to enroll