subtract two dates to get the number of days

From: "Campbell, Lance" <lance(at)illinois(dot)edu>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: subtract two dates to get the number of days
Date: 2010-07-13 14:58:53
Message-ID: B10E6810AC2A2F4EA7550D072CDE876004B2E65D@SAB-FENWICK.sab.uiuc.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I want to subtract to dates to know the number of days different.

Example:

01/02/2010 - 01/01/2010 = 1 day

08/01/2010 - 07/31/2010 = 1 day

How do I do this?

Thanks,

Lance Campbell

Software Architect/DBA/Project Manager

Web Services at Public Affairs

217-333-0382

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2010-07-13 15:02:10 Re: subtract two dates to get the number of days
Previous Message Pavel Stehule 2010-07-10 09:02:23 Re: How would I store little key-Nr to text lists?