pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedTrouble with dates
2+ messages / 2 participants
[nested] [flat]
* Trouble with dates
@ 1998-05-30 22:28 Bassel Hatoum <bassel@gnc.net>
0 siblings, 1 reply; 2+ messages in thread
From: Bassel Hatoum @ 1998-05-30 22:28 UTC (permalink / raw)
To: pgsql-sql
I'm trying to add months to a date without having to calculate how many
days in the month, etc.
Oracle has an add_month function that would do the trick. It there
anything similar in PGSQL? Or maybe a way to emulate it?
Thanks in advance.
Bassel Hatoum
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [SQL] Trouble with dates
@ 1998-05-31 16:56 Marin D <marin@cybernet.bg>
parent: Bassel Hatoum <bassel@gnc.net>
0 siblings, 0 replies; 2+ messages in thread
From: Marin D @ 1998-05-31 16:56 UTC (permalink / raw)
To: Bassel Hatoum <bassel@gnc.net>; +Cc: pgsql-sql
CREATE TABLE test (d DATE);
INSERT INTO test VALUES (CURRENT_DATE);
test=> SELECT DATE( DATETIME(d) + '1 month'::TIMESPAN) FROM test;
date
----------
30-06-1998
(1 row)
test=>
Hope this helps...
Marin
-= Why do we need gates in a world without fences? =-
On Sat, 30 May 1998, Bassel Hatoum wrote:
> I'm trying to add months to a date without having to calculate how many
> days in the month, etc.
> Oracle has an add_month function that would do the trick. It there
> anything similar in PGSQL? Or maybe a way to emulate it?
>
>
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1998-05-31 16:56 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-05-30 22:28 Trouble with dates Bassel Hatoum <bassel@gnc.net>
1998-05-31 16:56 ` Marin D <marin@cybernet.bg>
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