Re: datetime in 4GL
Posted in 1995
It looks to me as though specifying UNITS HOURS assumes an integer before it. It would be very reasonable. Why don't you try it out by replacing that calculation with > let dt2 = dt1 + 6.5 units hour # add the hours I suspect you will get the same answer as before. Have a good one! > Greetings fellow Informix 4GLer's: > > I have a question/obersevation converning using datetime in Informix > 4GL. Informix 4.11 running under SCO to be exact. Consider the > following stub code: > > main > define dt1, dt2, dt3, > time_tot decimal(6,2), > mins decimal(6,2) > > let dt1 = current > let time_tot = 6.5 > let mins = 6.5 * 60 > let dt2 = dt1 + time_tot units hour # add the hours > let dt3 = dt1 + mins units minute # add the minutes > end main > > You would think both dt2 and dt3 would be the same answer, but the > hours datetime calculation dt2, drops the decimal part of the hour. > The minutes calculation, dt3, is correct. > > This isn't a real "show stopper", but am I missing something here? > > Please advise, > > > ed > schaefer > > Malcolm Weallans Online Database Consultancy Phone 0628-72154 Fax 0628-37463 CIX - onlinedbc