db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruy Diaz Jara <diaz_...@yahoo.com>
Subject Subtracting fields in the Where Clause
Date Tue, 16 Nov 2004 05:33:38 GMT

I'm trying to familiarize myself with Torque and so far I've been having some
trouble porting SQL statements to Criteria. Currently, what I am attempting to
do is to get the following query (originally MySQL 4.0):

SELECT user_id
FROM subscribers s
WHERE to_days(s.end_of_subscription_date) - to_days(SYSDATE()) = 5

The query extracts a list of users whose subscriptions to a service will end in
5 days. How can I add a Criterion with a mathematical expression? Is it
possible or do I have to use BasePeer.executeQuery()?


Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 

To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

View raw message