Thanks to visit codestin.com
Credit goes to postgrespro.com

[SQL] Time related question... - Mailing 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.
                   [email protected]
           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...