I have Using pyodbc connection for python 2.7 with MS Access in Ubuntu 16.04
This Query working fine SELECT LogDate FROM DeviceLogs. but i will filter the data using date condition Query as SELECT LogDate FROM DeviceLogs WHERE UserId =? and LogDate >= ?.
This Issue i have already told and post following link
Code:
from_date = cur.fetchone()
from_date = from_date[0] - timedelta(0,19800)
date_input = '#' + str(from_date) + ' 06:26:46#'
print date_input,"AAAAAAAA"
from_date = str(from_date) + ' 00:00:00'
from_date = datetime.strptime(from_date, "%Y-%m-%d %H:%M:%S")
print from_date,"BBBBBBBBb"
sql="SELECT LogDate FROM DeviceLogs WHERE UserId =? and LogDate >= ? "
params = datetime(2016, 12, 01)
csr.execute(sql, '27797',params)
att_records = csr.fetchall()
print att_records,"AAAAAAAAAAAAAAAAAAAAAA"
ERROR Details below following
#2016-12-19 06:26:46# AAAAAAAA
2016-12-19 00:00:00 BBBBBBBBb
Traceback (most recent call last):
File "val.py", line 38, in <module>
csr.execute(sql, '27797',params)
pyodbc.Error: ('IM001', '[IM001] [unixODBC][Driver Manager]Driver does not support this function (0) (SQLNumParams)')