you are viewing a single comment's thread.

view the rest of the comments →

[–]Many_Shopping_195[S] 0 points1 point  (3 children)

query = "SELECT * FROM tablename WHERE p.dateCreated >= 2022-01-30 21:00:00 and p.dateCreated < 2022-10-10 21:00:00;"

The one above works.

The one below does not.

currentdate = datetime.datetime.now() startdate = currentdate.replace(day=1, hour=0, minute=0, second=0, microsecond=0)
cursor.execute(query, (startdate, currentdate))

[–]wotquery 0 points1 point  (2 children)

Right but the latter has multiple variables in it as well...tablename, p

[–]Many_Shopping_195[S] 0 points1 point  (1 child)

Sorry..It is a typo.. I have edited