Re: DateDiff in PostgreSQL

Поиск
Список
Период
Сортировка
От Tomasz Myrta
Тема Re: DateDiff in PostgreSQL
Дата
Msg-id 3FABA26D.5030900@klaster.net
обсуждение исходный текст
Ответ на DateDiff in PostgreSQL  ("George A.J" <jinujosein@yahoo.com>)
Список pgsql-sql
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



В списке pgsql-sql по дате отправления:

Предыдущее
От: Yasir Malik
Дата:
Сообщение: Re: DateDiff in PostgreSQL
Следующее
От: "George A.J"
Дата:
Сообщение: Re: DateDiff in PostgreSQL