mysql and DATE format

tim muddletin timmuddletin at news.vex.net
Wed Nov 24 23:56:14 EST 1999


sp00fD at yahoo.com (sp00fD) wrote in <81hhm6$ba2$1 at nnrp1.deja.com>:
>SELECT id, subject, author, text, DATE_FORMAT(date, \"%W, %d %b %Y\"), 

Another solution is to double the % characters you don't want 
translated by python. So for (just an) example....

>>> "DATE_FORMAT(%s, \"%%W, %%d %%b %%Y\")" % 'date'
'DATE_FORMAT(date, "%W, %d %b %Y")'

Note that only the first %s was translated. All the %% are transleted
to single %. 

...





More information about the Python-list mailing list