Re: Adding a stored number of minutes to a stored time

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: "Rob Richardson" <Rob(dot)Richardson(at)rad-con(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Adding a stored number of minutes to a stored time
Date: 2011-03-28 13:28:40
Message-ID: 5123E213-3FBA-40C4-AD11-1E558975AD73@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


On Mar 28, 2011, at 9:06, Rob Richardson wrote:

> Greetings!
>
>
>
> All of the examples I can find for adding a number of minutes to a
> timestamp show the number of minutes being hard-coded in the query. I
> have a table that has a column containing a starting time and another
> column containing the number of minutes until the process will be
> finished. I want to add the starting time and the number of minutes to
> calculate the finish time. How do I convert the minutes column from an
> int4 to an interval? Or is there a different way I should do that?

select some_timestamp_value + int4_col * interval '1 minute'

Michael Glaesemann
grzm seespotcode net

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Rob Richardson 2011-03-28 13:36:11 Re: Adding a stored number of minutes to a stored time
Previous Message Rob Richardson 2011-03-28 13:06:36 Adding a stored number of minutes to a stored time