Dear Mike,
To work around that limitation I created the following
three variables:
v1: DateTimeEntered (fvtrEnteredDT)
v2: DateTimeAssigned (fvtrAssignToDT)
v3: TimeUntilDispatched (fvtrDispTime)
-- calculate difference
SET VAR dtDiff = ( .fvtrAssignToDT - .fvtrEnteredDT )
-- display difference
SET VAR fvtrDispTime = +
( (FORMAT( (IFGT( (.DTdiff), 86400,(INT( (.DTdiff) /3600)),
+
(IHR( (RTIME(0,0, (.DTdiff) )) )) )), '99,900' )) +
+ ':' + (FORMAT( (IMIN( (RTIME(0,0,.DTdiff)) )),'00')) )
Using the same three time ranges the results are:
v1='08/09/95 12:15:30.123', v2a='08/10/95 13:15:30.123',
v3a= 25: 00
v1='08/09/95 12:15:30.123', v2b='08/11/95 13:15:30.123',
v3b= 49: 00
v1='08/09/95 12:15:30.123', v2c='08/12/95 13:15:30.123',
v3c= 73: 00
[suggesting also that my earlier v3b and v3c were each
short by 24 hours...]
Randy Peterson
----- Original Message -----
From: "randyp" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 17, 2002 2:31 PM
Subject: Re: Date and Time differences
> Dear Mike
>
> Apparently there is a 24 hour maximum to this
> calculation.
>
> The following values were calculated using R:Base 2000
> v6.5++ BUILD 1.859xRT03:
> v1='08/09/95 12:15:30.123', v2a='08/10/95 13:15:30.123',
> v3a= 3600
> v1='08/09/95 12:15:30.123', v2b='08/11/95 13:15:30.123',
> v3b= 3600
> v1='08/09/95 12:15:30.123', v2c='08/12/95 13:15:30.123',
> v3c= 3600
>
> SET VAR vElapsed = (RTIME(0,0,.v3)) will return the
> erroneous result 1:0:0.
> It is erroneous because it suggests that only one hour has
> elapsed even though > for the second and third instances,
>the elapsed time should be 25:0:0 and 49:0:0 respectively.
>
> Randy Peterson
>
> > SET VAR v1 DATETIME = '08/09/95 12:15:30.123'
> > SET VAR v2 DATETIME = '09/19/95 13:15:30.123'
> > SET VAR v3 INTEGER = ((TEXTRACT(.v2)) - (TEXTRACT(.v1)))
> >
> > This will return a value of 3600 in variable v3. This is
> your difference in seconds.
> >
> > You can expand things further by using the RTIME
function
> to change it into hours, minutes and seconds.
> >
> > Best Regards,
> >
> > Michael Willochell
>
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/