[Zope-DB] Insert Date in dtml-sqlvar
Julián Muñoz
jmunoz@softhome.net
Thu, 2 May 2002 18:48:59 +0000 (GMT)
Here are the answers I found some months ago to this question:
Note: really, I don't understand why this works, it's metaphysics.
Maybe someone could explain ??
-----------8<---------------
http://www.zope.org/Members/teyc/howSQLDateTime
arguments:
Mydate:date
Query template:
select * from activity where activity_date= { ts '<dtml-var Mydate
fmt=ISO>'
}
Thanks, That put me on the right track.
I also found a how-to on the subject
http://www.zope.org/Members/teyc/howSQLDateTime, which suggests:
select * from activity where activity_date= { ts '<dtml-var Mydate
fmt=ISO>'}
My final ZSQL method is:
select * from "Applicant Database"
where [Last Name] like <dtml-sqlvar LastName type=string>
and [First Name] like <dtml-sqlvar FirstName type=string>
and Position like <dtml-sqlvar Position type=string>
and [Date Received] between { ts '<dtml-var FromDate fmt=ISO
sql_quote>'}
and { ts '<dtml-var ThruDate fmt=ISO sql_quote>'}
-- Loren
------------8<----------
On Wed, 1 May 2002, Grant Thibdeau wrote:
> How does one insert a date into a datetime column through the sqlvar? The
> help says there is only int,float,string and nb. Do I need to use a
> regular dtml var? Sorry for the simple question,Thanks!
>
>
>
> _______________________________________________
> Zope-DB mailing list
> Zope-DB@zope.org
> http://lists.zope.org/mailman/listinfo/zope-db
>
--
__o
_ \<_
(_)/(_)
Saludos de Julián
EA4ACL
-.-
Foro Wireless Madrid
http://opennetworks.rg3.net