Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Hour calculation Post Reply Post New Topic
Author Message
andybrst
Newbie
Newbie


Joined: 04 Sep 2009
Online Status: Offline
Posts: 5
Quote andybrst Replybullet Topic: Hour calculation
     Posted: 21 Sep 2009 at 3:57am
I'm sorry if this is a newbie question, but.......
 
I wish to calculate one sum of hours(excel format [h]:mm:ss) with another within Crystal.
 
For example:
Joe Bloggs working month consists of:
  87:47:00 time on customer premises
100:46:00 travelling
 
Therefore total man month equals 188:33:00
 
Could anyone advise.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 21 Sep 2009 at 6:20am

I would start by creating a shared variable and give it the value of 1/1/1900 (because this is zero in SQL Server).  Then for every detail line, I would add the amount of work/travel performed using date add,probably in minutes, (this would probably be suppressed or hidden).  In the summary line, you would now have a date, which I would display something like:

shared numbervar worked;
local numbervar idays := day(worked);  //will give the number of days
totext(idays*24,0,"") + totext(worked, ":mm:ss")
 
HTH
 
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum