我在Ubuntu 16.04中使用带有MS Access的python 2.7的pyodbc连接
此查询工作正常 SELECT LogDate FROM DeviceLogs 。但我会使用日期条件查询过滤数据 SELECT LogDate FROM DeviceLogs WHERE UserId =?和LogDate> =?。
This Issue i have already told and post following link
代码:
do ... end
以下
下面的错误详情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"