dates

From: John Ensign <john(at)deepsnow(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: dates
Date: 2006-05-17 15:53:32
Message-ID: 32DCF556-BF0F-4996-B40A-79D29F648A62@deepsnow.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi all,

Coming from mysql, and about to lose my mind.

Dealing with yet another cms system here...

taking one field as text value and running it through to_date()...
works like a charm.

taking another text field which holds a char, casting to int4...

then trying to add the two to get another date as in:

select to_date( textfield1, 'MM-DD-YYYY') as startDate, CAST
( textfield2, int4) as duration, startDate + duration as endDate.

this doesnt work, and I can find anything concrete anywhere on it,
just sparse entries in the postgres manual posted pre 2000. = /

ive gone through several variations on intervals and they fail as well.

its not rocket science, but im losing my mind trying to do that
should take a few seconds tops.

thanks in advance,

bob

btw db version is 7.3 and i will have to get it to work in 7.4 as well.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2006-05-17 17:05:31 Re: dates
Previous Message David Gaudine 2006-05-17 15:43:59 Querying from two tables as if they were appended