using dates in pgsql

Поиск
Список
Период
Сортировка
От JohnH
Тема using dates in pgsql
Дата
Msg-id 61AE72B81760D511B2DC0002B345C83A1352EE@DFS1
обсуждение исходный текст
Ответы Re: using dates in pgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
G'Day to all those pgsql novices out there
 
I am trying to isolate those records where the active date is at least six months old
 
I have no problem if I use
 
SELECT * from newbuyers
WHERE activedate < '01/01/2003'
ORDER BY last_name
But I want to use a variable in the WHERE option 
 
WHERE  activedate < (current date less 188 days) 
 
active date is a database date field
 
I would like to include the calculation in the WHERE statement, but if I can't  should I create the (current date less 188 days) outside of the sql and bring it in as a <dtml-sqlvar ...> variable?  and if so how?
 
 
Thanks to anyone who can help

John Haley

 

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Returning SETOF INTEGER mystery...
Следующее
От: Bruno LEVEQUE
Дата:
Сообщение: Re: Database names and pg_dump