As you are using Acccess maybe you are using Olaf Schmidt's VB wrapper dhRichclient3 and in that case you do things like this:
select (cast(left$('16:30:00', 2) as integer) + cast(mid$('16:30:00', 4, 2) as real) / 60) - (cast(left$('08:00:00', 2) as integer) + cast(mid$('08:00:00', 4, 2) as real) / 60) Native SQLite with Julianday etc. will probably be quicker. RBS On Mon, Jan 10, 2011 at 7:42 AM, Sven <tabaluga...@yahoo.de> wrote: > Dear SQLite users, > > I've created a Microsoft Access 2003 database with three complex queries > written in pure SQL language. The function of the database is to > document and calculate the daily work-time. > > Today I want to convert this database to SQLite but I have problems with > my written queries: How can I calculate the difference of two times and > show the result as double value? > > For more information I'll include one example: One table hold the two > times (start_time, end_time) and the calculated result (shown in the > table as 'difference'): > > [code] > start_time | end_time | difference > 08:00:00 | 16:30:00 | 8.5 > [/code] > > The result of the difference between the two times (start_time, > end_time) shown in the table above as 'difference' will be calculated > with the following SQL-query code within Microsoft Access 2003: > > [code] > ( [end_time] - [start_time] ) * 24 > [/code] > > and returns the following data '8.5'. While using the following query > code within SQLite: > > [code] > select time(end_time) - time(start_time) > [/code] > > I only get the following data returned: '8' (but not '8.5' as calculated > with SQL). > > So currently I don't know what to do next to solve my problem and > perhaps all the other users of this SQLite-users mailing list could help > me out. > > best regards > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users