pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Margarit Nickolov <man@developer.digsys.bg>
To: The Hermit Hacker <scrappy@hub.org>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] adding time to a datetime field ... how?
Date: Wed, 15 Dec 1999 16:01:32 +0200 (EET)
Message-ID: <Pine.BSI.4.05L.9912151559510.19740-100000@developer.digsys.bg> (raw)
In-Reply-To: <Pine.BSF.4.21.9912150928390.8120-100000@thelab.hub.org>


select start_time,start_time+acctsessiontime::timespan from log;

On Wed, 15 Dec 1999, The Hermit Hacker wrote:

> 
> I hate coming up with subjects...
> 
> I have a table with two fields: start_time::datetime and
> acctsessiontime::int4...I want to add the second to the first, to give me
> a stop_time...
> 
> if I do:
> 
> select start_time,start_time+acctsessiontime from log;
> 
> I get a stop_time 'acctsessiontime' days after start_time, instead of
> 'acctsessiontime' seconds later...
> 
> Is there some way of telling it to pass seconds instead of days?
> 
> Thanks
> 
> Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
> Systems Administrator @ hub.org 
> primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 
> 
> 
> ************
> 
> 




view thread (5+ messages)  latest in thread

Message-ID: <Pine.BSI.4.05L.9912151559510.19740-100000@developer.digsys.bg>
Permalink:  ../Pine.BSI.4.05L.9912151559510.19740-100000@developer.digsys.bg/
Also on:    postgresql.org/message-id/Pine.BSI.4.05L.9912151559510.19740-100000@developer.digsys.bg

 · 

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: man@developer.digsys.bg, scrappy@hub.org
  Subject: Re: [SQL] adding time to a datetime field ... how?
  In-Reply-To: <Pine.BSI.4.05L.9912151559510.19740-100000@developer.digsys.bg>
  References: <Pine.BSF.4.21.9912150928390.8120-100000@thelab.hub.org> <Pine.BSI.4.05L.9912151559510.19740-100000@developer.digsys.bg>

* 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