From: john@flowlabs.com
To: pgsql-sql@postgresql.org
Subject: problems with date and interval queries.
Date: Mon, 10 Feb 2003 13:05:18 -0500 (EST)
Message-ID: <36167.24.136.118.31.1044900318.squirrel@zero.voxel.net> (raw)
I am having problems adding an interval to a date in a select statement
where the interval is specified as a selected column. Is this possible?
Below is an example of the query that I'm executing. The query gives and
error at the num_min column in the outer query. It works fine if that is
replaced with the text '90 minutes'. Thank you in advance for all help
provided.
-John
select message_id,
to_char((now() + ((interval num_min) *
(2 ^ (num_fail - (num_fail - fail_count))))),'mon DD YYYY HH24:MI:SS') as
abs_send_date,
fork_count
from (
select message_id, number_reattempt_failures as num_fail, resend_count as
fail_count,
(to_char(coalesce(minutes_between_reattempt, 90), '999') || ' minutes')
as num_min, last_completion_date as last_date, fork_count
from pa_mailblast_message
where send_state = 'sent' and
number_reattempt_failures > resend_count) a
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: john@flowlabs.com
Subject: Re: problems with date and interval queries.
In-Reply-To: <36167.24.136.118.31.1044900318.squirrel@zero.voxel.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