using dates in pgsql - Mailing list pgsql-novice

From JohnH
Subject using dates in pgsql
Date
Msg-id 61AE72B81760D511B2DC0002B345C83A1352EE@DFS1
Whole thread Raw
Responses Re: using dates in pgsql
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Returning SETOF INTEGER mystery...
Next
From: Bruno LEVEQUE
Date:
Subject: Re: Database names and pg_dump