Re: generated dates from record dates - suggestions - Mailing list pgsql-sql

From Jasen Betts
Subject Re: generated dates from record dates - suggestions
Date
Msg-id k0vqjd$obp$1@reversiblemaps.ath.cx
Whole thread Raw
In response to generated dates from record dates - suggestions  (Gary Stainburn <gary.stainburn@ringways.co.uk>)
Responses Re: generated dates from record dates - suggestions
List pgsql-sql
On 2012-08-20, Gary Stainburn <gary.stainburn@ringways.co.uk> wrote:
> Hi folks.
>
> I've got a table with three dates which are populated from an external source.
> I then want to have a view with two calculated dates in it, e.g.
>
> if date_1 is null and date_2 is null then date_a=NULL
> if date_1 is not null and date 2 is null then date_a=date_1+'90 days'
> if date_1 > date3 rhen date_b=date1 else date_b=date2
> etc.
>
> What's the best way to do this?

CASE looks good.

> I know it's a quite open question but I'm interested to hear different 
> responses

"date_b" on line three, is that a typo? if not how am i to interpret
it?

-- 
⚂⚃ 100% natural




pgsql-sql by date:

Previous
From: Gary Stainburn
Date:
Subject: Re: generated dates from record dates - suggestions
Next
From: Gary Stainburn
Date:
Subject: Re: generated dates from record dates - suggestions