Forum OpenACS Q&A: Re: learn to debug an error
9: Re: learn to debug an error (response to 8)
Posted by Jarkko Laine on 07/07/04 10:29 AM
No, you don't need to and shouldn't use trunc anymore. So your previous solution should've been correct. So use only
date_part('days',current_timestamp - max(coalesce(modified_date, insertion_date)))
or EXTRACT which is the SQL standard (I'm not sure if it works already in 7.3, but in 7.4 sure). Please read http://www.postgresql.org/docs/7.4/interactive/functions-datetime.html for information on how these functions should be used.