Re: [sqlalchemy] MySQL DATE_ADD function

2010-10-05 Thread Chris Withers
On 04/10/2010 22:53, Bryan wrote: I'm having trouble converting this SQL into an ORM statement. DATE_ADD(datecol, INTERVAL(1 - DAYOFWEEK(datecol)) DAY) This is as far as I can get, which is basically nowhere. The second argument to date_add requires literal strings INTERVAL and DAY, but I

Re: [sqlalchemy] MySQL DATE_ADD function

2010-10-05 Thread Bryan Vicknair
On Tue, Oct 5, 2010 at 1:58 AM, Chris Withers ch...@simplistix.co.uk wrote: Are you looking for something database agnostic or something that just works for MySQL? If the latter, look at text: http://www.sqlalchemy.org/docs/core/tutorial.html#using-text If the former, then you'll want a

[sqlalchemy] MySQL DATE_ADD function

2010-10-04 Thread Bryan
I'm having trouble converting this SQL into an ORM statement. DATE_ADD(datecol, INTERVAL(1 - DAYOFWEEK(datecol)) DAY) This is as far as I can get, which is basically nowhere. The second argument to date_add requires literal strings INTERVAL and DAY, but I also need to insert a function in the