Re: How to sum up the duration time based on the application used?

2009-01-22 Thread Martin Westin
>From http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html (first comment) SELECT SEC_TO_TIME( SUM( TIME_TO_SEC( `time` ) ) ) AS total_time FROM time_table; So you should be able to add a "fields" to your search where you put the above MySQL trick. You may also want to add a "GROU

How to sum up the duration time based on the application used?

2009-01-21 Thread Mr Chaz
$apps = $this->Application->find('all', array('conditions' => array ('Application.Username' => $username, 'Application.Duration !=' => null))); debug ($qwe = Set::combine($apps, '{n}.Application.id','{n}.Application.Duration', '{n}.Application.ProcessDescription')); Array (