I track work requests in an SQlite database. For each request in a
table named "Tasks" in the database, there is a
column holding the date the request was approved. Every week I need to include
the number of requests approved that week in a weekly report. I can do that with
the Structured
Query Language (SQL) command SELECT COUNT(*) FROM Tasks WHERE Approved
>= date(CURRENT_DATE,"-7 day")
. I have a
Python script that queries the
SQL database to count the requests approved within the last week,
but sometimes I want to determine the number of requests approved
since a particular date. So I modified the script to accept a date
provided as an argument on the command line and, if a date is
specified, to determine the number of entries where the approval
date matches the specified date or is later than the specified date.
[ More Info ]