+ 1

Query is invalid syntax in pyodbc python but working on mssql server

this is the query: select count(ID) as total_new_records from dbo.WarrantyCard where DATECREATED >= dateadd(day, datediff(day, 0, GetDate()) - 7, 0)

28th Nov 2020, 4:07 AM
Jessica Nicole Marcena
Jessica Nicole Marcena - avatar
1 ответ
+ 1
Maybe check if you are using the correct driver in your ODBC connection. This issue suggests other people have similar trouble with date handling in mssql via pyodbc... https://github.com/mkleehammer/pyodbc/issues/658
28th Nov 2020, 4:22 AM
Tibor Santa
Tibor Santa - avatar