Answer the question
In order to leave comments, you need to log in
Why is the result of a query executed in a .py file empty, while the same query from sqlbrowser works correctly?
This is the simple code:
import sqlite3
conn = sqlite3.connect('employees.sqlite')
cursor = conn.cursor()
cursor.execute(
"SELECT id, LastName, FirstName from employees WHERE strftime('%m',DOB) = strftime('%m','now') AND strftime('%d','now') = strftime('%d', DOB)")
results = cursor.fetchall()
print(results)
conn.close()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question