title: SQLAlchemy: how to filter date field?
body: <p>Here is model:</p>
  
  <pre><code>class User(Base):
      ...
      birthday = Column(Date, index=True)   #in database it's like '1987-01-17'
      ...
  </code></pre>
  
  <p>I want to filter between two dates, for example to choose all users in interval 18-30 years.</p>
  
  <p>How to implement it with SQLAlchemy?</p>
  
  <p>I think of:</p>
  
  <pre><code>query = DBSession.query(User).filter(
      and_(User.birthday &gt;= '1988-01-17', User.birthday &lt;= '1985-01-17')
  ) 
  
  # means age &gt;= 24 and age &lt;= 27
  </code></pre>
  
  <p>I know this is not correct, but how to do correct?</p>