Is There any function to get Difference of Dates

Поиск
Список
Период
Сортировка
От shreedhar
Тема Is There any function to get Difference of Dates
Дата
Msg-id 00a201c2bd42$c10b4e30$1201a8c0@a4005
обсуждение исходный текст
Ответы Re: Is There any function to get Difference of Dates  ("Rajesh Kumar Mallah." <mallah@trade-india.com>)
Re: Is There any function to get Difference of Dates  (Steve Crawford <scrawford@pinpointresearch.com>)
Список pgsql-admin
Hi All,

Is There any function to get Difference of Dates.

Here tdate is of type timestamp

If I tried

select * from temptbldate WHERE (EXTRACT(EPOCH FROM TIMESTAMP 'now()')  -
EXTRACT(EPOCH FROM TIMESTAMP tdate)  )/ 86400 < 2
I got error as 'Parse error at tdate'

select * from temptbldate WHERE (EXTRACT(EPOCH FROM TIMESTAMP 'now()')  -
EXTRACT(EPOCH FROM TIMESTAMP 'tdate')  )/ 86400 < 2
If I use 'tdate',  I got 'bad timestamp external representation 'tdate',
Probably it might be taking 'tdate' as string.

How can I use epoch to get difference of two dates.

Regards,
Sreedhar


"Faith, faith, faith in ourselves, faith, faith in God, this is the secret
of greatness.
If you have faith in all the three hundred and thirty millions of your
mythological gods,
and in all the gods which foreigners have now and again introduced into your
midst,
and still have no faith in yourselves, there is no salvation for you. "
(III. 190)


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

Предыдущее
От: "Rajesh Kumar Mallah."
Дата:
Сообщение: Re: How Copy 7.3 Schemas?
Следующее
От: "shreedhar"
Дата:
Сообщение: Re: Is There any function to get Difference of Dates