Re: [SQL] Time related question...
От | Patrice Hédé |
---|---|
Тема | Re: [SQL] Time related question... |
Дата | |
Msg-id | Pine.LNX.3.96.980617144048.3074A-100000@paris.ivo.fr обсуждение исходный текст |
Ответ на | [SQL] Time related question... (kcolagio@wc.eso.mc.xerox.com (Kevin Colagio)) |
Ответы |
Re: [SQL] Time related question...
|
Список | pgsql-sql |
On Wed, 17 Jun 1998, Kevin Colagio wrote: > > I have a database that tracks the service calls we do. In the database > are abstime values for: > dateentered > dateclosed > dateassigned > datecontacted Can't you design it with 'datetime' fields instead, which is much better handled ? then, you would be able to do exactly what you want ! > 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; with datetime, it could be then : select * from servicecall whre (dateclosed - dateentered) < '3 days'; However, if you really need abstime, I don't know the answer. Hope this helps Patrice -- Patrice HÉDÉ --------------------------------- patrice@idf.net ----- ... Ásólfr hljóp upp á skip Hrúts ok varð fjögurra manna bani, áðr Hrútr varð varr við. Sneri hann þá í móti honum. En er þeir fundust, lagði Ásólfr í skjöld Hrúts ok í gegnum, en Hrútr hjó til Ásólfs, ok varð þat banahögg. --- Njáls Saga ----- http://www.idf.net/patrice/ ----------------------------------
В списке pgsql-sql по дате отправления: