How to return an Int4 when subtracting dates/timestamps

From: Andre Lopes <lopes80andre(at)gmail(dot)com>
To: postgresql Forums <pgsql-general(at)postgresql(dot)org>
Subject: How to return an Int4 when subtracting dates/timestamps
Date: 2010-05-18 22:14:04
Message-ID: AANLkTim-16OtOF0ymbY6iWd9cgYKGXRQTnjz_Qcjky2F@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I need to return an Int4 when I do this king of select

[code]
select CURRENT_DATE - '2009-12-31' from tbl_sometable
[/code]

This select returns an Interval. How can I return an Integer? Like '138'

Sorry my bad english.

Best Regards,

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Landscheidt 2010-05-18 23:22:49 Re: How to return an Int4 when subtracting dates/timestamps
Previous Message Hernan Danielan 2010-05-18 19:18:48 Connection lost