I am trying to build a function for my SQlite database using python. The purpose of the function is to pull any date under the calibration_date field that is 1 to 5 days away from the current date.
I've tried messing with my format on the table itself, thinking it was a formatting issue. The function still pulls nothing.
def datecheck():
conn = sqlite3.connect("Calibration_Monitor.db")
cur = conn.cursor()
cur.execute("SELECT Serial, Calibration_Date from Masterlog where date(Calibration_Date) < (SELECT DATETIME('now', '+5 days'))")
print(cur.fetchall())
conn.commit()
conn.close()
Hoping someone can help me solve this mystery!
Anything helps :)