Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: time difference Post Reply Post New Topic
Author Message
bootsy1
Newbie
Newbie


Joined: 09 Mar 2010
Online Status: Offline
Posts: 1
Quote bootsy1 Replybullet Topic: time difference
     Posted: 09 Mar 2010 at 5:00am
Hi I am having trouble with a formula.  i have six fields, three date, and three times:
 
Fields:
Dispatch Date: Misc Date 9
Dispatch Time: SA215
Officer Arrival Date:  Misc Date 10
Officer Arrival Time:  SA216
Officer Completion Date:  Misc Date 11
Officer Completion Time:  SA217

What I want to do is combine the appropriate date and time together, and get the difference, and then get the average.  What I am ultimately trying to do is get the average response time.
 
Here is my formula so far:
stringvar dx := {IRSCLAIMSA1.SA215};
timevar dy := time(val(left(dx,2)),val(right(dx,2)),0);
datetime dz := datetime({IRSCLAIM.MISC9_DT},dy);
stringvar ax := {IRSCLAIMSA1.SA216};
timevar ay := time(val(left(ax,2)),val(right(ax,2)),0);
datetime az := datetime({IRSCLAIM.MISC10_DT},ay);
datediff("n",dz,az);
 
I get to the third line and at datetime it highlights the rest of the formula and says"the remaining text does not seem to be part of the formula.  Can someone help me? Thanks in advance!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 Mar 2010 at 6:11am
you want datetimeVAR
 
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