Alex Mandel wrote:
> DaleEMoore wrote:
>> I'd like to SUM(tripSeconds) and format output as
>> days.hours:minutes:seconds.hundredths, but have not been able to figure out
>> how to do that with sqlite. This didn't seem to come close:
>>
>> SELECT 
>> STRFTIME('%d', SUM(tripSeconds)) + '.' +
>> STRFTIME('%H', SUM(tripSeconds)) + ':' +
>> STRFTIME('%M', SUM(tripSeconds)) + ':' +
>> STRFTIME('%f', SUM(tripSeconds)) AS Duration, 
>> SUM(tripSeconds)
>>
>> Any ideas are appreciated,
>> Dale E. Moore

I assume this involves multiple lookups to get the time. It could so happen 
they 
are a different second, hour, day or even year. That looks dangerous to me.

> What about something like
> SELECT SUM(STRFTIME('%s', tripSeconds)) AS Duration
> from table
> GROUP BY trip
> 
> Alex


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to