On Thu, Jul 26, 2012 at 4:32 PM, C M <[email protected]> wrote:
> I could zero pad these strings myself, so that '9:00:00.000000'
> becomes '09:00:00.000000', but that would break other uses of these
> values in my code and was wondering if there were a way in SQlite to
> "see" these values as timedeltas.  I tried this:
>
> SELECT MIN(TIME(duration) FROM Durations
>
> but that returns nothing.

Just use CASE to add the missing zero as necessary, something like this:

SELECT strftime('%s', (SELECT CASE WHEN '9:12:32' LIKE '0%' THEN
'9:12:32' ELSE '0' || '9:12:32' END));

Replace '9:12:32' there with whatever expression, probably a column name.

Nico
--
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to