Sigh. Ok, I settled on:select '1987-01-29'::timestamp + interval '21 years' > now();Which is closer to what I wanted anyway (this was all about determining who was under 21 years old). This at least should be robust over leap years. Tom Lane wrote: There is nothing simple about datetime calculations, ever :-( -- ---- Visit http://www.not-so-obviously.com/ |
- [SQL] extract or date_part on an interval? How many e Bryce Nesbitt
- Re: [SQL] extract or date_part on an interval? Ho... Adrian Klaver
- Re: [SQL] extract or date_part on an interval? How... Tom Lane
- Re: [SQL] extract or date_part on an interval?... Bryce Nesbitt
- Re: [SQL] extract or date_part on an inter... Michael Glaesemann