× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.