Stripping the fractional part in select or ACE??!
Posted in 1994
Topics: General Discussion
This is driving me insane. We have an old version of Informix (4.00) running on our Aspect Call Center and the database was designed by Aspect to have time values stored as integers in the following manner: term_time is stored as a smallint where the first 2 digits are the hour, followed by minute and then second. So 9:45:03 am is stored as 94503 There are some other time values that are stored in regular seconds which I wish to subtract from the term_time value. Of course to manipulate both of these correctly I need to convert one or the other to the proper format so I have a formula that will essentially take seconds and convert it into the proper integer hhmmss format. But the formula involves stripping of the fraction part of the result of a divide. BUT INFORMIX SELECTs do not support ROUND or TRUNC as far as I can see. I get an unknown error when I try this in 4.00 even though the FAQ says that these math functions are undocumented but should work. The error in ISQL is -8516 I believe. Also my ACE report uses an after group of block where I use the group count feature to count certain rows with a certain criteria. It looks like this: group count where term_time - totalcalltimeinsecs >=5959 The totalcalltimeinsecs is a column which I selected but since I cannot convert it in the Select I need to convert it on the fly here in the group count. But my formula for conversion relies on the fact that the decimal of the quotient (ie totaltimeinsecs/3600) will be dumped. But it is not! It is only dumped when I assign the result to variable. But I need to do this on the fly. Any one out there have an Aspect CallCenter and ever dealt with this? The only thing I can think of is dump the group count way of doing this and count each row with a certain criteria I need separately into variables. That way I use on every row and can then do a calculation on every occurence of term_time using temporary variables to store intermediate results of my integerseconds->hhmmss format. I sure don't want to do this, but will I? Please reply to me personally and I will summarize or if you have a quick answer respond to the net please. Thanks `,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,` `,Alex Sirota,`,`,`,`,`,`,`Genius is an African that dreams of snow.` `,adapple@apple.com`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`-Vladimir Nabokov,` `,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,` `,http://atlantis.austin.apple.com/people.pages/adapple/adapple.html` `,`,`,`,`,`,`,`Apple Web Server: http://www.info.apple.com`,`,`,`,`,` `,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`,`