[SQL] Time related question...

From: kcolagio(at)wc(dot)eso(dot)mc(dot)xerox(dot)com (Kevin Colagio)
To: pgsql-sql(at)postgreSQL(dot)org
Subject: [SQL] Time related question...
Date: 1998-06-17 05:33:29
Message-ID: 199806171233.IAA01017@bentley.eso.mc.xerox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)wc(dot)eso(dot)mc(dot)xerox(dot)com
Personal URL:<http://www.rit.edu/~kdc5072>

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Benedikt Eric Heinen 1998-06-17 06:53:44 Internationalisation: SELECT str (ignoring Umlauts/Accents)
Previous Message Dim Zegebart 1998-06-17 04:58:01 Re: [SQL] psql