interval question

From: "Fernando P(dot) Schapachnik" <fernando(at)schapachnik(dot)com(dot)ar>
To: pgsql-general(at)postgresql(dot)org
Subject: interval question
Date: 2001-03-06 00:59:40
Message-ID: 200103060059.f260xeT01461@funes.schapachnik.com.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello:
Maybe somebody on the list can give me a hand with this. I
have:

id serial,
start time,
duration time

(That is, ids have an start time and a duration).

I want to know which ids are current, ie, which satisfy
start<=now<=start+duration.

The problem is that start+duration is an interval, and I
can't find the way to cast now to interval or interval to time or
tinterval in order to make the comparison.

Any ideas?

Thanks in advance.

Fernando P. Schapachnik
fernando(at)schapachnik(dot)com(dot)ar

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-03-06 01:04:30 Re: List of all system tables.
Previous Message Boulat Khakimov 2001-03-06 00:45:45 Re: Getting lengths of variable fields