How Many Years have Passed? - Mailing list pgsql-general

From Ian Harding
Subject How Many Years have Passed?
Date
Msg-id sc209067.069@mail.tpchd.org
Whole thread Raw
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Query hangs when getting too complex...
Next
From: Joseph Shraibman
Date:
Subject: sql scripts