Re: Portable SQL to compute a date difference in seconds???



johan.de.taeye@xxxxxxxxx wrote:
Hi all,

I am trying to get a portable SQL statement that returns the
difference between 2 dates as a number of seconds.
Is there any possibility to use standard SQL functions to achieve
this?

In PostgreSQL one can use: extract(epoch from (date1 - date2))
In MySQL one can use: datediff(date1,date2) * 86400
In Access one can use: DateDiff("s",date1,date2)
etc...
None of the above pleases me - I'ld like a common expression for all
these databases.

Regards,

Johan

Time to understand that even if these products all are called DBMSes
it doesn't mean all are the same or even similar.

Gints Plivna
http://www.gplivna.eu

.