Sv: Adding Time in a Numeric World
Ole Hansen, ScanConsult
oh@scanconsult.dk
Mon, 3 Jul 2000 20:19:52 +0200
Hi Joseph,
FWIW, here is what I did in a similar situation years back :
Convert you time-values to minutes :
DEFINE TOTMINS INT*4 = 60 * NCONVERT(ASCII(time_value,4)[1:2] + &
NCONVERT(ASCII(time_value,4)[3:2]
Do your subtotals to a subfile, and report from the subfile, converting back to hours and minutes :
DEFINE HOURS INT*4 = ROUND(TOTMINS/60,0)
DEFINE MINS INT*2 = MOD(TOTMINS,60)
HTH
/Ole Hansen
====================================================================
E-mail: oh@scanconsult.dk Cell Phone: +45 22 17 36 50
====================================================================
ScanConsult IT-Partners Voice : +45 87 34 55 07
Udviklingsparken Aarhus Fax : +45 87 34 15 07
Soenderhoej 46 Support : support@scanconsult.dk
DK-8260 Viby J. Sales : sales@scanconsult.dk
Denmark Web : http://www.scanconsult.dk
=== M A C H : Menu-based Air Cargo Handling system ===
=== ScanConsult is Authorized by Hewlett-Packard as: ===
=== * HP 3000 Select Independent Software Vendor * ===
=== ** HP9000 Power Partner ** ===
-----Oprindelig meddelelse-----
Fra: Joseph Rosenblatt <jrosenblatt@i2sworld.com>
Til: powerh-l <powerh-l@sphere.swau.edu>
Dato: 3. juli 2000 19:46
Emne: Adding Time in a Numeric World
>
>I am running PH v 8.09 on an HP e3000 979/200 with MPE 5.5 PP 7.
>I have a field called TIME defined as numeric 4 with a picture of "^^:^^".
>It has two defined components: HOURS numeric 2 and MINUTES numeric 2. It is
>itself part of a larger element DATE-TIME numeric 12.
>
>My problem is that I want to subtotal the TIME field. Since this field is
>numeric it works in decimal. Since time is not really a function of base 10,
>I have a problem. I have tried SUBTOTALing the minutes and hours separately
>but this does not help.
>
>Short of redefining this element as DATETIME data type (and I don't know if
>that will help) how do I SUBTOTAL these fields?
>
>Thanks for any help.
>
>Joseph Rosenblatt
>
>= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
>Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
>Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
>This list is closed, thus to post to the list, you must be a subscriber.
>
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.