Jul-07-2021, 08:31 PM
Hi,
I have a table that has thedate field with text data type. I am trying to insert current date:
I have a table that has thedate field with text data type. I am trying to insert current date:
c2.execute("INSERT INTO exam_registration_history VALUES (:name, :exam_type, :token, :taken, :enabled, :thedate)", { 'name': thefullname, 'exam_type': theexamchoosen, 'token': '', 'taken': '', 'enabled': '', 'thedate': 'datetime("now")', })i get the string stored as it is datetime("now") and not the date and if I take the quotes datetime('now') i get this error:
Error:'thedate': datetime("now"),
TypeError: an integer is required (got type str)
thanks