:version: 1.0.12
:released:
+ .. change::
+ :tags: bug, mssql
+ :tickets: 3624
+ :pullreq: bitbucket:70
+
+ Fixed the syntax of the :func:`.extract` function when used on
+ MSSQL against a datetime value; the quotes around the keyword
+ are removed. Pull request courtesy Guillaume Doumenc.
+
.. change::
:tags: bug, orm
:tickets: 3623
result_processor, 'abc'
)
+ def test_extract(self):
+ from sqlalchemy import extract
+ fivedaysago = datetime.datetime.now() \
+ - datetime.timedelta(days=5)
+ for field, exp in ('year', fivedaysago.year), \
+ ('month', fivedaysago.month), ('day', fivedaysago.day):
+ r = testing.db.execute(
+ select([
+ extract(field, fivedaysago)])
+ ).scalar()
+ eq_(r, exp)
+
class TypeDDLTest(fixtures.TestBase):