[SQL] Time related question... - Mailing list pgsql-sql

From kcolagio@wc.eso.mc.xerox.com (Kevin Colagio)
Subject [SQL] Time related question...
Date
Msg-id 199806171233.IAA01017@bentley.eso.mc.xerox.com
Whole thread Raw
Responses Re: [SQL] Time related question...  (Patrice Hédé <patrice@idf.net>)
Re: [SQL] Time related question...  (Herouth Maoz <herouth@oumail.openu.ac.il>)
List pgsql-sql
I have a database that tracks the service calls we do.  In the database
are abstime values for:
  dateentered
  dateclosed
  dateassigned
  datecontacted

I have perl scripts managing the interaction between our web site and the
database.

My question is: what is the SQL statement that will allow me to find:
  1) a list of the calls where the difference between the dateentered and
  dateclosed is less than (say) 3 days.

I have tried:
  Select * from servicecall where (dateentered <#> dateclosed) #<= 3 days;
  Select * from servicecall where (dateclosed  - dateentered) #<= 3 days;
  Select * from servicecall where (dateentered <#> dateclosed) #<= @3 days;
  Select * from servicecall where (dateclosed  - dateentered) #<= @3 days;

Any suggestions?

Thanks.

--

        Kevin Colagio, Systems Administrator, Webmaster,
                      and perpetual student.
                   kcolagio@wc.eso.mc.xerox.com
           Personal URL:<http://www.rit.edu/~kdc5072>

pgsql-sql by date:

Previous
From: Benedikt Eric Heinen
Date:
Subject: Re: [SQL] Internationalisation: SELECT str (ignoring Umlauts/Accents)
Next
From: Patrice Hédé
Date:
Subject: Re: [SQL] Time related question...