How Many Years have Passed?

Поиск
Список
Период
Сортировка
От Ian Harding
Тема How Many Years have Passed?
Дата
Msg-id sc209067.069@mail.tpchd.org
обсуждение исходный текст
Список pgsql-general
I have checked the FAQ and other sources and learned that the difference between two dates is the integer number of
days. I want to know how many years are between those two dates.   

Is the only way to do that to do something like checking the julian day first to see if the second one is higher (i.e.
it'spast my birthday), then doing date_part('year', foo) - date_part('year', bar) and adjusting for whether my birthday
haspassed? 

Thanks!

Ian A. Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
(253) 798-3549
mailto: iharding@tpchd.org


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Query hangs when getting too complex...
Следующее
От: Joseph Shraibman
Дата:
Сообщение: sql scripts