Calculating the difference between two time values by means of SQL
Two columns of a table (for the database engine “HyperSQL” within the application
“LibreOffice Base 220.127.116.11-985.1”) have got the data type “TIME”.
I would like to compute a difference for these fields.
It seems that the following SQL statement is insufficient so far.
SELECT ID, t1, t2, t2 - t1 AS duration FROM time_measurements1
I would appreciate your advices.
Would you like to point further information sources out besides query examples
which work with dates and time stamps?
> SELECT ID, t1, t2, t2 - t1 AS duration FROM time_measurements1
You are looking for the function DATEDIFF(string, datetime1, datetime2)
Could be this works, if you have choosen a datetime field, not only a
SELECT ID, t1, t2, DATEDIFF('hour', t1, t2) AS duration FROM
> Would you like to point further information sources out besides query examples
> which work with dates and time stamps?
You are German, right?
have a look at "Base Handbuch" and also "Base Beispiele". In "Base
Beispiele" is an example für getting times for running or something like