Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Formula Frustration : ( Post Reply Post New Topic
Author Message
Stenachi
Newbie
Newbie
Avatar

Joined: 02 Nov 2009
Location: United States
Online Status: Offline
Posts: 4
Quote Stenachi Replybullet Topic: Formula Frustration : (
     Posted: 02 Nov 2009 at 12:43am

I need to total hours worked and cannot figure it out.  The hours are in MIL time.  Also, one shift spans days; ie. 23:00 - 07:00.  If anyone knows a good formula for this please help!

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 02 Nov 2009 at 6:33am
have you tried DateDiff()? it will calculate the hours and takes the date into account. dateDiff(timeType, startDate, endDate)--

datediff(hour,'1/1/09 23:00','1/2/09 07:00') //gives 8

IP IP Logged
Stenachi
Newbie
Newbie
Avatar

Joined: 02 Nov 2009
Location: United States
Online Status: Offline
Posts: 4
Quote Stenachi Replybullet Posted: 02 Nov 2009 at 9:17pm
Thanks for your help.  I am very new at Crystal reports and not a programmer by trade.  After I finish building these reports I need to figure out how to upload it to Telestaff.  If you have any expierience with this I would appreciate any help you can give. 
IP IP Logged
Stenachi
Newbie
Newbie
Avatar

Joined: 02 Nov 2009
Location: United States
Online Status: Offline
Posts: 4
Quote Stenachi Replybullet Posted: 02 Nov 2009 at 11:30pm
CR is telling me there is not enough arguments for "hour".  Any thoughts?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Nov 2009 at 6:09am
Sorry that is the SQL syntax. Try replacing the hour with "h" (including the quotes)
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