Re: ACE Report Calculation Using DATETIME Type
Posted in 1997
Ftwymgs wrote: > > I am trying to write an ACE Report that does calculations on columns of type > DATETIME YEAR TO MINUTE and I am really stuck.... > > What I have is two fields BEGIN_TIME and CLOSE_TIME of type DATETIME. These > fields represent the time a trouble ticket was opened and closed. I want > to produce a report that calculates the total number of times a ticket was > closed > within 15 minutes, within 4 hours and over 24 hours. > > I can't figure out how to calculate the difference in minutes of these two > fields. > > Can anyone offer any help? The difference between two datetimes is an interval, so I think you'll need an interval variable My ace is really rusty, so below is 4GL syntax you'll have to translate, although I'm pretty sure all concepts will apply to ace: DEFINE tr_duration INTERVAL HOUR(4) TO MINUTE ... LET tr_duration = CLOSE_TIME - BEGIN_TIME IF tr_duration > INTERVAL( 24:00 HOUR TO MINUTE ) THEN ... Check my syntax, but that's the basic idea. -- //////////////// ======================================================= ////////// // Dennis J. Pimple Informix Software, Inc. ////// / /// Principal Consultant 6300 S Syracuse Way Ste 205 ///// // //// dennisp@informix.com Englewood CO 80111 //// // ///// /// // ////// recept: 303-850-0210 // // /////// direct: 303-740-5611 Opinions expressed are mine, / /////////// fax: 303-779-4025 and do not necessarily //////////////// http://www.informix.com reflect those of my employer