Dnia 2003-11-07 14:34, Użytkownik George A.J napisał:
Hi,

i am converting a MSSQL Server database to PostgreSQL.

Using PostgreSQL version 7.3.2.

Is there any function like the DateDiff() in MSSQL Server.

ie, a function that returns difference of two dates(timestamp) in days or months or year..

The - operator for timestamp retuns the intervel in days only.

1. You can convert timestamps to dates and then substract them. The result will be days::integer.


2. Interval result is not a problem - you can extract epoch from it. The result is seconds::integer - do whatever you want with it.

Regards,
Tomasz Myrta


---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster

Reply via email to