I have an
SQLite database that I use to track approval of tasks. Every Monday,
I need to generate a count of the number of tasks approved from the prior
Tuesday through the Monday on which I'm creating the report. The approval
dates are stored in the database as an integer and I enter them in the
form 2018-05-14
. I use the following
SQL command in a
Python script to determine the number I've approved
in the last week:
sql = 'SELECT COUNT(*) FROM Tasks WHERE Approved >= date(CURRENT_DATE,"-6 day")'
But I noticed that the count didn't always include the tasks I approved on the prior Tuesday. E.g., when I ran the script tonight, May 14, the number reported was 5, yet I expected the result to be 7.
[ More Info ]