[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 ??



Query template:

select *  from activity where  activity_date= {  ts '<dtml-var Mydate

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

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
        and  { ts '<dtml-var ThruDate fmt=ISO sql_quote>'}

 -- Loren


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


    _ \<_

Saludos de Julián

Foro Wireless Madrid