DU = []
for i in range(len(DD)):
DU += [DD[i]+' '+UU[i]]
dtDate = []
for i in range(len(DU)):
dtDate = dtDate + [time.strptime(DU[i],"%d.%m.%Y %H:%M:%S")]
#readin access
path = './'
acc_fname = 'test.mdb'
DRV = '{Microsoft Access Driver (*.mdb, *.accdb)}'
MDB = path + acc_fname
PWD = ''
con = pyodbc.connect('DRIVER={};DBQ={};PWD={}'.format(DRV,MDB,PWD))
cur = con.cursor()
for i in range(3):
SQL = 'SELECT ID FROM Tab WHERE Tab.FileZeit = {0};'.format(dtDate[i])
table_2 = cur.execute(SQL).fetchall()
print(table_2)
then i got this error:
pyodbc.ProgrammingError: ('42000', "[42000] [Microsoft][ODBC-Treiber f\ufffdr Microsoft Access] Undefined function 'time.struct_time' in Ausdruck. (-3102) (SQLExecDirectW)")
DD & UU Are lists with date and time, then i convert them to datetime(dtDate). Filezeit is also a datetime type.