pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ed <ed@jetumele.com>
To: pgsql sql <pgsql-sql@postgresql.org>
Subject: Sum of datetime différence...
Date: Thu, 8 Jun 2000 15:39:58 -0400
Message-ID: <000901bfd181$544297e0$b48c29d1@citenet.net> (raw)

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@jetumele.com





Message-ID: <000901bfd181$544297e0$b48c29d1@citenet.net>
Permalink:  ../000901bfd181$544297e0$b48c29d1@citenet.net/
Also on:    postgresql.org/message-id/000901bfd181$544297e0$b48c29d1@citenet.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: ed@jetumele.com
  Subject: Re: Sum of datetime différence...
  In-Reply-To: <000901bfd181$544297e0$b48c29d1@citenet.net>
  References: <000901bfd181$544297e0$b48c29d1@citenet.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox