> Hi,
> 
> I've a model with a DateTime column and I need to select rows where the time 
> part of this column is between two hours (something like: select all rows 
> where the date is between 6:00 and 11:00).
> 
> I need the date information, rows must be deleted after a couple of days.
> 
> I don't know how-to extract the time part of my DateTime field in 
> ".filter()". Should I add a Time column  ? Or is it possible to use only the 
> DateTime column?
> 
> 
> Thanks.
> -- 
> Laurent Meunier <laur...@deltalima.net>
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.


Hi Laurent

I'm sure there is a better way, but you could always filter using a date/time 
and supply the date part as well (i.e. today) so that you are comparing 
datetime to datetime.  (Something like: select all rows where the datetime is 
between 2013-08-30 06:00:00 and 2013-08-30 11:00:00)  :-)

Cheers
Warwick

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to