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



It sounds like you got it working, already.   Here's a sample of doing
the same thing with timestamps instead of date/time fields.  Someone
might find it useful someday, who knows? :)

     D timethen        S               Z   inz(z'2002-02-27-16.30.27')
     D timenow         S               Z   inz(*sys)
     D totalmin        S             10i 0
     D min             S             10i 0
     D hrs             S             10i 0

     c     timenow       subdur    timethen      totalmin:*mn
     c                   eval      hrs = %div(totalmin:60)
     c                   eval      min = %rem(totalmin:60)
     c                   dump
     c                   eval      *inlr = *on


On Tue, 21 May 2002, Dean Bathke wrote:

> Thanks Martin
>
> I couldnt find much info on %DIFF although it DOES roll off the tongue
> rather nicely, LOL
> In any case I found this little sample and modified it to work as I needed
> it to.
> If you have any info or examples you want to share concerning the %DIFF BIF,
> Id love to see it..
> Thanks
>
>
> Dtimenow          S               T   inz(*sys)
> Dtimethen         s               t   inz(T'16.30.27')
> Ddatenow          s               d   inz(*sys)
> Ddatethen         s               d   inz(D'2002-02-27')
> Dmin              s             10i 0
> Dtotalmin         s             10i 0
> Ddays             s             10i 0
> Dhrs              s             10i 0
> C     timenow       subdur    timethen      min:*mn
> C     datenow       subdur    datethen      days:*d
> C                   eval      totalmin = days * 1440 + min
> C                   eval      hrs = %div(totalmin:60)
> C                   eval      min = %rem(totalmin:60)
> C                   dump
> C                   eval      *inlr = *on
>



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.