Print Page | Close Window

Display number of minutes in HH:MM format

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14269
Printed Date: 20 Apr 2025 at 11:55am


Topic: Display number of minutes in HH:MM format
Posted By: sanjeewalk
Subject: Display number of minutes in HH:MM format
Date Posted: 05 Sep 2011 at 12:03am

Hi,

I am working on a report in [ASP.NET + VS2008 , Crystal Reports + SQL Server 2008] environment.


I have a data column which returns me number of minutes in integer format.


I need to get total number of minutes for a given emp, which I managed to get using;


1. Add formula field

2. use Change Summary Operation

3. Selected Sum as calculate this summary.


So now I get the total no of minutes in a text object in the report. Next I need to display this in HH:MM which I am unable to find a way.


For ex : Total mins = 73 Should Be 01:13


I have not mastered crystal reports and struggling to get this done...Any help is highly appreciated... Thanks in advance..




Replies:
Posted By: hilfy
Date Posted: 06 Sep 2011 at 11:34am
Try something like this:
ToText({minutes}\60, 0) + ':' + ToText({minutes} mod 60, 0)
 
Using the back-slash (\) to divide does an "Integer Divide" which gives you just the integer portion of the division.  "Mod" gives you the remainder from the integer divide.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window