Crystal Reports & SQL Reporting Services Training Consultants
Account Log in:
Username:
Password:
Genius has limits, stupidity has none.
 
Institute of IT Trainers - Freelance Trainer of the Year 2006 & 2009
Liverpool Business Connect Member
  Maximum Impact Solutions Limited - Reporting Solutions, Creating Answers
Reporting Solutions - Creating Answers, Crystal Reports, Dashboarding (Xcelsius) & SQL Reporting Services

The Maximum Impact Solutions Blog Feed ME!!!!

06
June

How Do I Display Hours and Minutes in Crystal Reports 2008?

A number of clients have asked me the same question recently, "How do I display the difference between two date-times fields, in hours and minutes, in Crystal Reports?"


Solution:

 This is more easily accomplished using the "Display String" of the field in question.
  1. Create the formula to calaculate the difference between the two date-time fields, in minutes
  2. Add the formula field to the report
  3. Right click on the field
  4. Select the Format Field menu option
  5. In the Format Editor dialog box, click on the Common Tab
  6. Click on the X+2 button to the right of Display String format option
  7. Enter the following formula :
  8. NumberVar Hrs := Truncate(CurrentFieldValue/60);

    Numbervar Mins := Remainder(CurrentFieldValue,60);

    Totext(Hrs,0) + " Hrs " + ToText(Mins,0) + " Mins"
  9. Press the OK button

If you have any questions, leave us a comment below, or need any assistance, please do not hesitate to Contact Us




1

Joolz

22
August
Thanks that was really useful
2

Training

22
August
So glad that you got it to work

MAKE A COMMENT

Name *

Email Address *

Comment *

To prove you are human what is:

43 + 95 =