Skip to content

Commit 8738f62

Browse files
julian-patmosOskarPersson
authored andcommitted
Update operations.py (#27)
1 parent 1e70d2c commit 8738f62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql_server/pyodbc/operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def date_interval_sql(self, timedelta):
126126
def date_trunc_sql(self, lookup_type, field_name):
127127
CONVERT_YEAR = 'CONVERT(varchar, DATEPART(year, %s))' % field_name
128128
CONVERT_QUARTER = 'CONVERT(varchar, 1+((DATEPART(quarter, %s)-1)*3))' % field_name
129-
CONVERT_MONTH = 'CONVERT(varchar, 1+((DATEPART(quarter, %s)-1)*3))' % field_name
129+
CONVERT_MONTH = 'CONVERT(varchar, DATEPART(month, %s))' % field_name
130130

131131
if lookup_type == 'year':
132132
return "CONVERT(datetime2, %s + '/01/01')" % CONVERT_YEAR

0 commit comments

Comments
 (0)