Re: [libreoffice-users] Calculating the difference between two time values by means of SQL

2021-03-08 Thread Markus Elfring
> You are looking for the function DATEDIFF(string, datetime1, datetime2)

Thanks for your information.

I got distracted by the key word “DATE” while I was looking for the support of
an other time unit.
An SQL statement like the following can fit to my application needs.

SELECT "day", "start", "stop",
   DATEDIFF( 'minute', "start", "stop" ) / 60.000 AS "duration"
FROM "time_measurements";


Will any adjustments become more helpful also for the software documentation?

Regards,
Markus

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


[libreoffice-users] Calculating the difference between two time values by means of SQL

2021-03-04 Thread Markus Elfring
Hello,

Two columns of a table (for the database engine “HyperSQL” within the 
application
“LibreOffice Base 7.1.0.3-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?

Regards,
Markus

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy