SQL Server and MySQL date function cheat sheet, and why BETWEEN misses times on the last day
SQL

SQL Date Functions Explained Simply (SQL Server and MySQL)

The date functions you’ll use most in SQL Server and MySQL: current date, DATEADD, DATEDIFF, month end and formatting, plus the BETWEEN mistake that makes monthly totals wrong.