Date Math

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Date Math
Дата
Msg-id Pine.LNX.4.64.0705070931310.20021@salmo.appl-ecosys.com
обсуждение исходный текст
Ответы Re: Date Math  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Список pgsql-general
   I've read both Section 8.5 of the on-line 8.2.4 docs, and the pertinent
sections of Douglas & Douglas, and I'm still not certain that I'm correctly
expressing the query I want. Please correct as needed.

   From table (Permits) I want to identify those which expire within a
specified time from today. For example:

     SELECT permit_nbr, title, date_issued, term,
         process_time from Permits
     WHERE (date_issued + term YEARS)
         < (CURRENT_DATE + process_time MONTHS);

   Should I use TODAY rather than CURRENT_DATE? Do I need to cast intervals
explicitly from seconds to days, months, or years?

Rich

--
Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.        |          Accelerator(TM)
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Any "guide to indexes" exists?
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Date Math