Tom:

It may look something like the following, taken from a water-meter monitoring application under development:

--Calculate the decimal time elapsed on the previous read-day
  SET VAR vReadHourPREV = (IHR(.vReadTimePREV))
  SET VAR vReadMinsPREV = ((IMIN(.vReadTimePREV))/60 )
  SET VAR vReadTimePREV_NUM = (.vReadHourPREV + .vReadMinsPREV )
  SET VAR vFirstDayElapsedHourCOUNT = ( 24 - .vReadTimePREV_NUM )

--Calculate the decimal time elapsed on the current read-day
  SET VAR vReadHourCURR = (IHR(.vReadTimeCURR))
  SET VAR vReadMinsCURR = ((IMIN(.vReadTimeCURR))/60 )
  SET VAR vReadTimeCURR_NUM = (.vReadHourCURR + .vReadMinsCURR )
  SET VAR vLastDayElapsedHourCOUNT = .vReadTimeCURR_NUM

--Calculate the Total Elapsed decimal time
  SET VAR vReadIntervalHourTOTAL = +
  (BRND((.vFirstDayElapsedHourCOUNT + +
         .vReadInterval24HourCOUNT + +
         .vLastDayElapsedHourCOUNT ),8,.01))

Meter readers note the time and date of reading. The full routine calculates:
- The number of hours on the first day between the reading and midnight
- The number of hours on the last day between midnight and reading
- The number of full 24-hour days between (which is not your issue)

Hope this helps

Bruce Chitiea
SafeSectors, Inc.
909.238.9012 mobile

------ Original Message ------
Sent: 3/4/2016 10:33:19 AM
Subject: [RBASE-L] - Midnight shift notes
From: "Tom Frederick" <[email protected]>
To: [email protected]
Cc:

We have to track activity by shift and write a note for record purposes. All notes have a staff ID, topic, actual note, date and start/end times which provides proof of activity. Right now I can bill activity by a whole day, but a change to billing by the hour is coming. For day and evening shifts it is pretty easy. They stay same day and within a consecutive time frame. Overnight shifts have to deal with Midnight date/time changes to automatically split over two dates and make 24 hour clock time adjustments. I can check for overlap or bad start/stop times within the same date. Making adjustments for Midnight date/time is just not clicking in my head. Any suggestions are welcome.

Tom Frederick
President/CEO
Elm City Center
1314 W Walnut
Jacksonville, IL 62650
O-217-245-9504
F-217-245-2350
[email protected]<mailto:[email protected]>

Reply via email to