I'm querying into a SQL server to fetch a DATETIME value. Now I want to insert this value into another table. This is my script:
cursor2.execute(query1)
items = cursor2.fetchall()
for item in items:
cursor1.execute(query2, [item[0]])
c_date = cursor1.fetchone()
print(type(c_date)) #here type is <class 'pypyodbc.TupleRow.<locals>.Row'>
if c_date is not None:
cursor2.execute(query3, [c_date, item[0]])
How do I convert this TupleRow into a DATETIME SQL value? Currently I'm getting this error because of type incompatibility:
TypeError: 'type' object is not subscriptable