Re: interval type
Posted in 1995
Topics: General Discussion
> On Jun 28, 10:21am, I wrote: > > } ->Can I convert some how ? > > > > Have a look at the extend function. You use this to change the definition of > a > > datetime or interval field to make it match other datetime and interval > fields > > to allow calculations and reformatting. > > Sorry Bert, > > I should take my own advise to others. Look before you leap. Extend only > applies to datetime not to intervals. Cathy's route is probably the way to go. > > Perhaps Informix should include a function that coverts a datetime or interval > to an integer using a specified level. Eg: > > timeconvert (datetime/interval expression) into seconds > > Jonathan? Worth putting in the request database? > > Cheers - Jim > > -- > ----------------------------------------------------------------------------- > Jim Gordon DHL Airways Inc. jgordon@us.dhl.com > ----------------------------------------------------------------------------- > My opinions are my own. They may vary with time but they remain mine! > I took some of cathy's ideas but it is just not quite right. can someone explane what is happening here. The group values work great, but the grand totals does not. rpt.callduration is an interval hour to second define rpt record like callrecord.*, calldur interval hour to second, call5 interval hour(5) to second, call7 interval hour(7) to second, ucallsum interval hour(5) to second, tcallsum interval hour(7) to second, ucnt integer, tcnt integer [...] on every row let calldur = rpt.callduration let call5 = calldur let call7 = calldur after group of rpt.username let ucallsum = group sum(call5) let ucnt = group count(*) print column 1, rpt.username, column 20, ucnt, column 35, ucallsum, column 55, ucallsum/ucnt on last row let tcallsum = sum(call7) let tcnt = count(*) print column 1, "GRAND TOTALS", column 20, tcnt, column 35, tcallsum, column 55, tcallsum/tcnt [...]