cursor.execute("SELECT price FROM statistic WHERE `date` = {} AND `time` = {}".format(date,f"{deltime_1.hour}:{deltime_1.minute}"))
Что же тут не так то
1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':27' at line 1