RE: rounding interval type to nearest 15 minute
Posted in 1996
In <54p0dp$mmt@cssun.mathcs.emory.edu> spal@watson.den.csci.csc.com (CSC CIS) writes: > >Marc Sorry, but I don't think this will work. An interval is like a character string and dividing by an integer is going to be meaningless. Marc, I'll take a look at this for you. regards, ed schaefer > >How about >rounded_interval = (interval % 15) < 7.5 ? > interval - (interval % 15) : interval + (15 - (interval % 15)); > >This is C code, but you can adapt 4GL (or any other language) to the same logic. You can even write a function or macro to reuse it. > >Hope this helps > >Sujit Pal >DBA, Computer Sciences Corp. >---------- >From: Marc Kneppers[SMTP:marc@pamco.com] >Sent: Thursday, October 17, 1996 9:27 AM >To: informix-list@rmy.emory.edu >Subject: rounding interval type to nearest 15 minute > >Well, the subject says it all. > >ANyone have an easy way of rounding an interval up or down to the >nearest 15 minute interval? > >am I missing something obvious? > >MArc > >---------------------------------------------------------------------- --- >Marc Kneppers >System Administrator and Everything-Under-the-Sun-guy >PAMCO >marc@pamco.com >---------------------------------------------------------------------- --- >"Kiss my Royal Canadian" > > > > >