[Zope-dev] Sqlmethod use to query ZopeTime.

Jim Sanford jsanford@atinucleus.com
Fri, 18 Feb 2000 10:01:49 -0600


I use Visual FoxPro tables via ODBC.

Here is how I would write this:

select somedata from Mydatabase
where date()-regist_time < <dtml-sqlvar cal type=float>

Remember, most database backends have functions that can be used in the SQL query.   [ date() is a FoxPro function ]

Using ZopeTime would be more convoluted:

select  somedata from Mydatabase
where  ctod(<dtml-sqlvar "ZopeTime().mm()+'/'+ZopeTime().dd()+'/'+_.str(ZopeTime().year())" type=string>) - regist_time <
<dtml-sqlvar cal type=float>

[ctod() is a foxpro function]

----- Original Message -----
From: <Victor.Zhai@ogilvy.com>
To: <zope-dev@zope.org>
Sent: Friday, February 18, 2000 5:35 AM
Subject: [Zope-dev] Sqlmethod use to query ZopeTime.



Hi,all

select  somedata from Mydatabase
where
     ZopeTime() - Mydatabase.regist_time < cal  (Note: cal can be any data
from 0 to 365)
How to realize this?
 Thanks a lot!
 Victor zhai.



"WorldSecure Server <ogilvy.com>" made the following
 annotations on 02/18/00 06:24:47
------------------------------------------------------------------------------
Privileged/Confidential Information may be contained in this message.  If you are not the addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you
should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not
consent to email for messages of this kind.  Opinions, conclusions and other information in this message that do not relate to the
official business of the Ogilvy Group shall be understood as neither given nor endorsed by it.

==============================================================================


_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )