Re: Calculating Differences Between Dates - Problem

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Hunter Hillegas <lists(at)lastonepicked(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Calculating Differences Between Dates - Problem
Date: 2003-01-10 21:02:58
Message-ID: 20030110210258.GA27412@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jan 10, 2003 at 12:35:37 -0800,
Hunter Hillegas <lists(at)lastonepicked(dot)com> wrote:
> I am trying to calculate the number of days between two dates.

Just subtract the dates from each other. The result will be an integer type
with the number of days between the two dates.

> date_shipped: 2002-12-16
> date_of_request: 2002-10-29
> date_difference: 18
> NOT OK - it is more days than this.

You are just comparing the days of the month, not the actual days.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Simon Mitchell 2003-01-10 21:17:23 Re: Calculating Differences Between Dates - Problem
Previous Message Ian Harding 2003-01-10 21:01:10 Demo System...