While running the below python script, getting errors. can someone help?
query1 = "SELECT Date AS \"time\",jobType,sum(CJob) AS \"sum(CJob)\" FROM logs WHERE Date = '06/01/2021' and jobType is not null GROUP BY jobType ORDER BY Date"
mycursor.execute(query1)
myresult1 = mycursor.fetchone()
print("Total Completed orders in Logs Table(New DB) :%s " % myresult1)
Getting this below error.
File "C:\Users\santhosh.mohana\python_scripts\clow.py", line 35, in <module>
print("Total Completed orders in Logs Table(New DB) : %s " % myresult1)
TypeError: not all arguments converted during string formatting
When i keep it as %d, i am getting this one
File "C:\Users\santhosh.mohana\python_scripts\clow.py", line 35, in <module>
print("Total Completed orders in Logs Table(New DB) : %d " % myresult1)
TypeError: %d format: a number is required, not str
myresult1will be tuple with 3 elements. you have only one placeholder%s. And in any case use new-style string formatting or f-strings.