Re: Simplicity in time/date functions - Mailing list pgsql-general

From Vince Vielhaber
Subject Re: Simplicity in time/date functions
Date
Msg-id Pine.BSF.4.40.0201031509320.19504-100000@paprika.michvhf.com
Whole thread Raw
In response to Simplicity in time/date functions  ("Ben-Nes Michael" <miki@canaan.co.il>)
List pgsql-general
On Thu, 3 Jan 2002, Ben-Nes Michael wrote:

> Hi All
>
> I was amazed that:
> select current_date() - 28 dont work at postgresql :(
>
> I checked here and there and found that in postgresql i need to do something
> like this:
>
> select current_date::TIMESTAMP - '28 days'::INTERVAL as date
>
> whow, is there a shorter way ?

template1=# select now() - 28;
  ?column?
------------
 12-06-2001
(1 row)

template1=#

That's with 7.1.2, as someone else pointed out your original way
works in 7.2.

Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH    email: vev@michvhf.com    http://www.pop4.net
         56K Nationwide Dialup from $16.00/mo at Pop4 Networking
        Online Campground Directory    http://www.camping-usa.com
       Online Giftshop Superstore    http://www.cloudninegifts.com
==========================================================================




pgsql-general by date:

Previous
From: Darren Ferguson
Date:
Subject: Re: Simplicity in time/date functions
Next
From: Frank Bax
Date:
Subject: Re: Simplicity in time/date functions