Re: Calculating Differences Between Dates - Problem - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Calculating Differences Between Dates - Problem
Date
Msg-id 20030110210258.GA27412@wolff.to
Whole thread Raw
In response to Calculating Differences Between Dates - Problem  (Hunter Hillegas <lists@lastonepicked.com>)
Responses Re: Calculating Differences Between Dates - Problem
List pgsql-general
On Fri, Jan 10, 2003 at 12:35:37 -0800,
  Hunter Hillegas <lists@lastonepicked.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.

pgsql-general by date:

Previous
From: Hunter Hillegas
Date:
Subject: Calculating Differences Between Dates - Problem
Next
From: "Ian Harding"
Date:
Subject: Demo System...