David
You could give this code a try. I'm allowing that check in and check out
could be different days.
Buddy
*********Code Starts Here*************
CLEAR ALL VAR
SET TIME FORMAT 'HH:MM'
SET VAR vchkin DATETIME = '01/12/2018 21:25'
SET VAR vchkout DATETIME = '01/13/2018 01:45'
--SET VAR vchkout DATETIME = '01/12/2018 23:45'
SET VAR vchkindate DATE = (DEXTRACT(.vchkin))
SET VAR vchkoutdate DATE = (DEXTRACT(.vchkout))
SET VAR vchkintime1 TIME = (TEXTRACT(.vchkin))
SET VAR vchkouttime1 TIME = (TEXTRACT(.vchkout))
SET VAR vmidnight TIME = 23:59
IF vchkindate = .vchkoutdate THEN
SET VAR velapsedtime1 TIME = (RTIME(0,0,.vchkouttime1 - .vchkintime1))
ELSE
SET VAR vminspstmidn INTEGER = (INT(SGET(CTXT(.vchkouttime1),2,4)))
SET VAR vhrsspstmidn INTEGER = (INT(SGET(CTXT(.vchkouttime1),2,1)))
SET VAR velapsedtime1 TIME = (RTIME(0,0,.vmidnight - .vchkintime1))
IF vhrsspstmidn <> 0 THEN
SET VAR velapsedtime1 = (ADDHR(.velapsedtime1,.vhrsspstmidn))
ENDIF
IF vminspstmidn <> 0 THEN
SET VAR velapsedtime1 = (ADDMIN(.velapsedtime1,.vminspstmidn))
ENDIF
ENDIF
SET VAR vmsg = ('Total Elapsed Time (HH:MM) =' & (CTXT(.velapsedtime1)))
PAUSE 2 USING .vmsg ICON INFO
RETURN
*********Code Ends Here**************
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of
dkfowler6179
Sent: Friday, January 12, 2018 9:10 PM
To: RBASE-L <[email protected]>
Subject: [RBASE-L] - Elapsed time in HH:MM format
I've been able to get elapsed time between a start and end time as a real
number. Need to get this to HH:MM format though. Columns ckin and ckout are
datetime format (as time sometimes span from one day to the next). I'm sure
this is something pretty simple, but I haven't been able to figure it out.
Thanks for any help.
David Fowler
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.