func. is generic.  use func.str_to_date().

http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/expressions.html#sqlalchemy.sql.expression.func

the plain text approach is valid as well, and you'd fetch that as  
column zero, i.e. session.execute(<text>).fetchone()[0] or  
execute(..).scalar().

On Jul 10, 2009, at 6:57 PM, Alex wrote:

>
> Update: it seems to me that the SQL function STR_TO_DATE() would work
> for this, but sqlalchemy.func doesn't seem to include it.  I tried
> using session.execute to specify a literal SQL statement: date =
> session.execute('SELECT STR_TO_DATE(date, "%W %D of %M %Y %r") FROM
> ipLog_myHome LIMIT 2') but for some reason it just spits out "None"
> for the dates.  I'm not sure why, that's the format of the string in
> the database.
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to