[Zope] Treating 00:00 as hh:mm

Michael Billimoria 2blaze@optushome.com.au
Fri, 24 Aug 2001 13:50:10 +1000


Hi there,

I'm having a minor problem with an SQL statement that's being called
from Zope to add up some times.

Basically times are entered into a database field called "timetaken" in
the format of hh:mm

I am trying to compile a report to add up the times and give them back
in the format of hh:mm

Unfortunately using SUM(timetaken) decides to truncate the characters
after the ":" and not add them up as hours.

Similarly using the SQL REPLACE string command to remove the ":" will
then proceed to add the values as decimal values.

Is there a simple way? The column itself is defined as a varchar 
currently, I've tried defining it as time, but it doesn't seem to work 
properly as it takes time as being clock time (hh:mm:ss AM/PM)

Hope someone can help!

Many thanks,

Michael Billimoria