[Zope-dev] I'm having troubles with MySQL MONTHNAME() function
Julio Flores Schwarzbeck
jflores@codeit.com
Fri, 27 Oct 2000 14:38:11 -0700 (PDT)
Actually, what you need to do is place the MONTH MySQL function INSIDE
your SQL Method, like so:
select month(mydate) as mDate from myTable
and evaluate it from zope as:
<dtml-if "mDate=='1'">Enero
..
..
-=-=-=-=-=-=-=-=-=-=-=- ESPANOL FOLLOWS (oops) -=-=-=-=-=-=-=-=-=-
De hecho, lo que tienes que hacer es poner la function MONTH de MySQL
DENTRO de tu metodo SQL, de la siguiente manera:
select month(mydate) as mDate from myTable
y evaluarlo desde zope asi:
<dtml-if "mDate=='1'">Enero
..
..
Julio F. Schwarzbeck
jflores@codeit.com
On Fri, 27 Oct 2000, Andres Sanchez Gomez wrote:
> Hello:
>
> I'm from Argentina, as you shoud now, I speak spanish. I'm usig MySQL,
> as you sould also now, it's in English.
> I have to give de time informatio in letters. Like 'Febrero' (02,
> February).
> I found two ways, but non of them gives me good results.
> The first way is to ask to the database a select statemment with it's
> own MONTHNAME() functio. But I couldn't translate to Spanish that is
> what I need.
> The other way is to make a little function that compares the month
> number (selected with te MONTH() function). In this case I had the same
> trouble:
> I can't compare a DateTime MySQL function var with an other var.
> I can't do this:
> <dtml-if " Month(DATE)==' 1' >Diciembre
> <dtml-elif " Month(DATE)==' 2' >Febrero
> etc....
>
> Thanks to anyone who can help me, or read me.
> And please, forget my english.
>
> Andres Sanchez Gomez
>
>
>
>
> _______________________________________________
> 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 )
>
>