Subtracting time fields

From: Kevin Old <kold(at)carolina(dot)rr(dot)com>
To: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Subtracting time fields
Date: 2002-11-01 22:05:26
Message-ID: 1036188325.6778.67.camel@oc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello all,

I have two fields in my database access_time and release_time.....I
would like to calculate the "duration" between these two values, but
can't figure out what to do.

I've tried something like this but it doesn't work:

select access_time, release_time, time(access_time) - time(release_time)
as duration from mastertbl limit 10

Any suggestions?

Thanks,
Kevin
--
Kevin Old <kold(at)carolina(dot)rr(dot)com>

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-11-01 22:09:01 Re: making queries more effecient
Previous Message Chad Thompson 2002-11-01 22:04:42 Re: making queries more effecient