Simple SQL Script Using DATEDIFF() Function

Job ID: 31863247

Budget: $10 – $30 USD

Microsoft SQL database has a table, “Manufacture”, that has two columns: “BatchCloseDate” and “ShipDate”.

The script will calculate the date difference (in days) between BatchCloseDate and ShipDate for all rows in the Manufacture table, and then calculate the percentage of rows in which the date difference is more than 10 days for a given month. Do not include any row with ShipDate = NULL.

I do not mind having to manually input month start date and month end date if that is easier to do.

Example: There are 100 rows with a ShipDate in January. Of those rows, 5 rows had date differences of more than 5. On running the script, the percentage displayed is 95%.