Re: [GENERAL] Interval Rounding

2007-06-01 Thread Michael Glaesemann
On Jun 1, 2007, at 13:00 , Mike Ginsburg wrote: age() is exactly what I needed. Now I just feel dumb for not looking into it. As far as getting the highest unit (day, month, year, etc) I am currently using CASES SELECT CASE WHEN (now() - change_time) < '1 min'::interva

Re: [GENERAL] Interval Rounding

2007-06-01 Thread Mike Ginsburg
age() is exactly what I needed. Now I just feel dumb for not looking into it. As far as getting the highest unit (day, month, year, etc) I am currently using CASES SELECT CASE WHEN (now() - change_time) < '1 min'::interval THEN date_part('seconds', age(now(), change_time))

Re: [GENERAL] Interval Rounding

2007-06-01 Thread Michael Glaesemann
On Jun 1, 2007, at 12:11 , Mike Ginsburg wrote: SELECT NOW() - change_time FROM ... to get the interval, and am attempting to use either EXTRACT() or DATE_PART() to get the appropriate value, but the interval doesn't contain any unit higher than days. It'd be helpful to me to see the res