开发者

Comparing Dates in Openoffice Database with HSQLDB

开发者 https://www.devze.com 2023-01-08 19:24 出处:网络
I have a table in an Openoffice Database, containing two date columns. I\'m trying to create a view that will aggregate all the rows in these columns and sum up the difference between these two column

I have a table in an Openoffice Database, containing two date columns. I'm trying to create a view that will aggregate all the rows in these columns and sum up the difference between these two columns in minutes开发者_高级运维.

This is pretty trivial, and in Postgres it would look like:

SELECT SUM(EndDate-BeginDate) AS total_minutes FROM mytable

What is the equivalent syntax in HSQLDB? I can't find much documentation on their date functions, and all the "standard" methods I'm familiar with return a syntax error.


It's a similar syntax in HSQLDB 2.0

SELECT SUM((EndDate-BeginDate) MINUTE) AS total_minutes FROM mytable

In HSQLDB 1.8.x used in OpenOffice, try the DATEDIFF() function as documented in the HSQLDB Guide

0

精彩评论

暂无评论...
验证码 换一张
取 消