Simple(?) 4gl question
Posted in 1999
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
In article <7ov9th$dv1@newsstand.cit.cornell.edu>, Respectful <please_reply@newsgroup.com> wrote: >suppose I want to find time difference for two variables expressed as year >to fraction , say l_start and l_end (l_diff is also the same type) > >if I say > >l_start = current >sleep 5 >l_end = current >l_diff = l_end - l-start > >l_diff when displayed shows all zeros, I'd like to say 5 seconds (or >whatever) > >any ideas? Curious, it works for me. This program: | main | | define l_start, l_end datetime year to fraction(3) | define l_diff interval day to fraction(3) | | let l_start = current | sleep 5 | let l_end = current | let l_diff = l_end - l_start | | display l_diff | | end main display this: | 0 00:00:05.009
suppose I want to find time difference for two variables expressed as year to fraction , say l_start and l_end (l_diff is also the same type) if I say l_start = current sleep 5 l_end = current l_diff = l_end - l-start l_diff when displayed shows all zeros, I'd like to say 5 seconds (or whatever) any ideas?
And your way works for me, thanks, it was lack of interval definition Paul Roberts <proberts@lynx.informix.com> wrote in message news:7ovajn$hcs1@webint.na.informix.com... > In article <7ov9th$dv1@newsstand.cit.cornell.edu>, > Respectful <please_reply@newsgroup.com> wrote: > >suppose I want to find time difference for two variables expressed as year > >to fraction , say l_start and l_end (l_diff is also the same type) > > > >if I say > > > >l_start = current > >sleep 5 > >l_end = current > >l_diff = l_end - l-start > > > >l_diff when displayed shows all zeros, I'd like to say 5 seconds (or > >whatever) > > > >any ideas? > > Curious, it works for me. This program: > > | main > | > | define l_start, l_end datetime year to fraction(3) > | define l_diff interval day to fraction(3) > | > | let l_start = current > | sleep 5 > | let l_end = current > | let l_diff = l_end - l_start > | > | display l_diff > | > | end main > > display this: > > | 0 00:00:05.009 > >