Re: [GENERAL] Can't EXTRACT number of months from an INTERVAL

2010-07-01 Thread Eliot, Christopher
Thanks! justify_interval is what I needed, I had never heard of it. I was already prepared to deal with getting the years and multiplying by 12. Topher [] On Jun 30, 2010, at 18:45 , Eliot, Christopher wrote: > I need to read a timestamp from the database and turn that into an integer > des

Re: [GENERAL] Can't EXTRACT number of months from an INTERVAL

2010-06-30 Thread Michael Glaesemann
On Jun 30, 2010, at 18:45 , Eliot, Christopher wrote: > I need to read a timestamp from the database and turn that into an integer > describing how many months ago the event happened, rounding downward. The > events are guaranteed to be in the past. =# select timestamp '2010-06-26 00:00:00' -

[GENERAL] Can't EXTRACT number of months from an INTERVAL

2010-06-30 Thread Eliot, Christopher
I need to read a timestamp from the database and turn that into an integer describing how many months ago the event happened, rounding downward. The events are guaranteed to be in the past. To start with, I tried subtracting a sample timestamp as would be found in the DB from my benchmark date