I'm tryng to do something like this..
con = sqlite3.connect('tables.db')
cur = con.cursor()
max_tyme = '2022-06-22 17:14:01.048'
cur.execute(f'''SELECT A.ID, B, A, tyme
FROM A, BD
WHERE A.ID = BD.ID
AND tyme > {max_tyme}''')
Resulting in this error: Traceback (most recent call last): File "d:\MEGA\test\test.py", line 11, in cur.execute(f'''SELECT A.ID, B, A, tyme sqlite3.OperationalError: near "17": syntax error
When I try..
con = sqlite3.connect('tables.db')
cur = con.cursor()
max_tyme = '2022-06-22 17:14:01.048'
cur.execute(f'''SELECT A.ID, B, A, tyme
FROM A, BD
WHERE A.ID = BD.ID
AND tyme > '2022-06-22 17:14:01.048' ''')
It works as it's supposed to, but I really need to use a variable. As I can see, the problem is whitespace, but I can't change the format of datetime.
Please help! Thanks!