|
Hi Mark,
> Where I am stuck is how to get the duration between two sets of dates.times.
> I know I probably need to move to date/time type fields but after that.
> would like time duration to be in hrs/minutes.
Assuming that you can convert the fields to date & time fields, then
here's what you'll need to do next:
a) Combine the date & time fields into a timestamp field (data type Z)
b) Use the SUBDUR op-code or %DIFF() BIF to calculate the duration between
them.
Here's a trivial example:
D Date1 s D inz(d'2004-07-13')
D Date2 s D inz(d'2004-07-14')
D Time1 s T inz(t'19.41.00')
D Time2 s T inz(t'07.25.00')
D Ts1 s Z
D Ts2 s Z
D MinsApart s 10I 0
c eval ts1 = Date1 + Time1
c eval ts2 = Date2 + Time2
c eval MinsApart = %diff(ts2: ts1: *minutes)
c dsply MinsApart
c eval *inlr = *on
---
Scott Klement http://www.scottklement.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.