Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalchemy@googlegroups.com] On Behalf Of Simon King
Sent: Friday, October 04, 2013 7:01 PM
To: sqlalchemy@googlegroups.com
Subject: Re: [sqlalchemy] Query for date between a range
I'm not sure that will work on it's own, will it? When used
Dear all,
I've a table where the date is separated in single fields, one for
year, one for day and one for month. So I need to query for a date
range. I search in Internet and I found the following query that seems
to be works:
SELECT *
FROM plan
WHERE year * 1 + month * 100 + day BETWEEN
] Query for date between a range
Dear all,
I've a table where the date is separated in single fields, one for year, one
for day and one for month. So I need to query for a date range. I search in
Internet and I found the following query that seems to be works:
SELECT *
FROM plan
WHERE year * 1
Subject: Re: [sqlalchemy] Query for date between a range
On Fri, 4 Oct 2013 15:55:07 +0300
Ofir Herzas herz...@gmail.com wrote:
You can create a custom field in your model and check against it:
class Plan(Base):
.
.
.
@property
def calculated_date(self):
return
tail.
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalchemy@googlegroups.com] On Behalf Of Enrico Morelli
Sent: Friday, October 04, 2013 4:05 PM
To: sqlalchemy@googlegroups.com
Subject: Re: [sqlalchemy] Query for date between a range
On Fri, 4 Oct 2013 15:55:07
no attribute 'between'
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalchemy@googlegroups.com] On Behalf Of Enrico Morelli
Sent: Friday, October 04, 2013 12:07 PM
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Query for date between a range
, 2013 4:05 PM
To: sqlalchemy@googlegroups.com
Subject: Re: [sqlalchemy] Query for date between a range
On Fri, 4 Oct 2013 15:55:07 +0300
Ofir Herzas herz...@gmail.com wrote:
You can create a custom field in your model and check against it:
class Plan(Base):
.
.
.
@property
That query looks weird.
I'd suggest converting everything to a date in the database and having the
db sort it --
on postgres it would look like this --
create table test_date ( id serial primary key not null , int , mm int
, dd int );
select *
from
test_date
where
(
: Friday, October 04, 2013 4:05 PM
To: sqlalchemy@googlegroups.com
Subject: Re: [sqlalchemy] Query for date between a range
On Fri, 4 Oct 2013 15:55:07 +0300
Ofir Herzas herz...@gmail.com wrote:
You can create a custom field in your model and check against it:
class Plan(Base