Re: Simplicity in time/date functions

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: Darren Ferguson <darren(at)crystalballinc(dot)com>
Cc: Ben-Nes Michael <miki(at)canaan(dot)co(dot)il>, pgsql-general(at)postgresql(dot)org
Subject: Re: Simplicity in time/date functions
Date: 2002-01-03 20:02:25
Message-ID: 3.0.6.32.20020103150225.01b64320@pop6.sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

7.1 didn't like (), but otherwise still works.

fbax=# select current_date - 28;
?column?
------------
2001-12-06

Frank

At 02:44 PM 1/3/02 -0500, Darren Ferguson wrote:
>dev=> select current_date() - 28;
> ?column?
>------------
> 2001-12-06
>
>Works for 7.2b
>
>Darren
>
>
>Darren Ferguson
>Software Engineer
>Openband
>
>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 ?
>>
>> --------------------------
>> Canaan Surfing Ltd.
>> Internet Service Providers
>> Ben-Nes Michael - Manager
>> Tel: 972-4-6991122
>> http://sites.canaan.co.il
>> --------------------------
>>
>>
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 6: Have you searched our list archives?
>>
>> http://archives.postgresql.org
>>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
>message can get through to the mailing list cleanly
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vince Vielhaber 2002-01-03 20:10:58 Re: Simplicity in time/date functions
Previous Message Darren Ferguson 2002-01-03 19:44:35 Re: Simplicity in time/date functions