[Zope-DB] Question on ZSQL and Dates

Charlie Clark charlie@begeistert.org
Wed, 23 Oct 2002 15:15:06 +0000


Hi, 

I've been struggling for a while with this one: I need to be able compare 
dates/ages in a ZSQL-query and don't seem to be able to do it right.

table person
name varchar(20),
id int,
birthdate date

Now I want to be able to select all rows in the table for people who are 
currently over 45 years old.

SELECT * FROM person
WHERE
45 <=3D '<dtml-var expr=3D"_.DateTime().Date()">' - person.birthdate

but as this doesn't work, I know I'm doing something wrong.
Any ideas? Searched all over so far but have yet to find anything helpful 
:-(

Charlie
-- 
Charlie Clark
Helmholtzstr. 20
D=1Asseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226