On 7/6/07, Andreas Jung <[EMAIL PROTECTED]> wrote: > > > --On 6. Juli 2007 23:27:30 +0000 jose <[EMAIL PROTECTED]> wrote: > > > > > I've got a question that I can't find the answer to. I have a table > > called seminars with a date field in it to hold the seminar dates. I > > want to query the table to find all the dates for a specific year. I > > tried query(Seminars).filter(Seminars.c.date.year==2007) but this gave > > me an error stating that the col does not have a year property. So > > how should I do this? > > Jose > > > > > func.to_char(table.c.date, 'YYYY') == '2007' > > or by using between(table.c.date, datetime(2007,1,1) , datetime(2007,31, > 12)) or something like that...
Or func.year(table.c.date) == 2007 -- Mike Orr <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---