Re: How to return an INT4 subtracting dates? - Mailing list pgsql-general

From Pavel Stehule
Subject Re: How to return an INT4 subtracting dates?
Date
Msg-id AANLkTikcBAK-h-XDuShUKFoNm1JeFmGwzY_-ZHYq7XA4@mail.gmail.com
Whole thread Raw
In response to How to return an INT4 subtracting dates?  (Andre Lopes <lopes80andre@gmail.com>)
List pgsql-general
Hello

2010/6/9 Andre Lopes <lopes80andre@gmail.com>:
> Hi,
>
> I need to return an int4 subtracting two dates, but returns me an interval.
>
> select
> end_date - now() as interger_number
> from hist_anuncios
>
> How to return an integer out of this?
>
>
> Best Regards,
>
>

postgres=# select '2010-06-18'::date - CURRENT_DATE;
 ?column?
----------
        9
(1 row)

Regards

pavel Stehule

pgsql-general by date:

Previous
From: Andre Lopes
Date:
Subject: How to return an INT4 subtracting dates?
Next
From: Raymond O'Donnell
Date:
Subject: Re: How to return an INT4 subtracting dates?