Sum of datetime différence...

From: "Ed" <ed(at)jetumele(dot)com>
To: "pgsql sql" <pgsql-sql(at)postgresql(dot)org>
Subject: Sum of datetime différence...
Date: 2000-06-08 19:39:58
Message-ID: 000901bfd181$544297e0$b48c29d1@citenet.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I would like to know what is the easiest way to add multiple difference of
datetime but show the result in hour and minute something like :

table foo:

start datetime
end datetime

I would like to do :

select sum(end-start) from foo;

but it gives me 3 days 12 hours 23 minutes...etc

I would like to see 84 hours and 23 minutes...

How can I do this?

PS: Is there a way to know which week of the year a current day is in?

Frédéric Boucher
Ed(at)jetumele(dot)com

Browse pgsql-sql by date

  From Date Subject
Next Message Brian Powell 2000-06-08 19:54:28 Help with inserts into Views
Previous Message Stephan Szabo 2000-06-08 18:15:08 Re: Problem with subquery in CHECK constraint.