Re: [sqlalchemy] Date range query problem

2016-03-02 Thread Jonathan Vanasco
Just FYI, there is a small edge-case in that approach if the db stores time with microseconds. If that's the case, you may be better off comparing to a 'floored" date column, or using a search where you grab values ">=" the start and "<" the end. Otherwise you'll miss values that happen

Re: [sqlalchemy] Date range query problem

2016-03-02 Thread Nana Okyere
Thanks. I added a time part to the datetime.datetime object as: end_dt = datetime.datetime.combine(pd.Timestamp(form.to_dt.data).to_datetime(), datetime.time(23,59,59)) Then I passed end_dt to the query. it works great. -- You received this message because you are subscribed to the Google

Re: [sqlalchemy] Date range query problem

2016-03-01 Thread Nana Okyere
Ok. How do you guys suggest I make the query to capture results for the end point date? -- 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

Re: [sqlalchemy] Date range query problem

2016-03-01 Thread Simon King
On Tue, Mar 1, 2016 at 4:17 PM, Nana Okyere wrote: > Mike, thanks for your response. I turned on the echo to see the values. > Looks like it is passing a datetime.date objects. So I don't see a time > part of the date. Here's the relevant part of the echo output. > > I selected

Re: [sqlalchemy] Date range query problem

2016-03-01 Thread Nana Okyere
Mike, thanks for your response. I turned on the echo to see the values. Looks like it is passing a datetime.date objects. So I don't see a time part of the date. Here's the relevant part of the echo output. I selected between two days ago and yesterday. It includes results for two days ago but

Re: [sqlalchemy] Date range query problem

2016-02-29 Thread Mike Bayer
On 02/29/2016 06:01 PM, Nana Okyere wrote: I have a model and one of its attributes is a column called last_updated_timestamp . It is a date column set to datetime.datetime.now() . That's all good. I'm trying to query for some roles based on a date range. So I do: results =

[sqlalchemy] Date range query problem

2016-02-29 Thread Nana Okyere
I have a model and one of its attributes is a column called last_updated_timestamp . It is a date column set to datetime.datetime.now() . That's all good. I'm trying to query for some roles based on a date range. So I do: results =