Use an explicit anniversary rule for calculating age in T-SQL, including February 29, years-months-days output and birthday lookups.
SQL SERVER – Get Time in Hour:Minute Format from a Datetime – Get Date Part Only from Datetime
Get the time in Hour:Minute Format, or just the date, from a DATETIME with CONVERT styles 108 and 101, or with the TIME and DATE types in SQL Server 2008.
SQL SERVER – Find Last Date Time Updated for Any Table
Want the last date time a table was updated without an UpdatedDate column? The sys.dm_db_index_usage_stats DMV shows it. A quick demo on AdventureWorks.
DATEFROMPARTS: Build Dates With Explicit Components
DATEFROMPARTS avoids ambiguous text assembly. Preserve year, month and day inputs while separating missing components from invalid calendar dates.
End-of-Day Balances From a Transaction Table
A transaction table stores movements, not balances. Collapse each day, run a total, fill the quiet days and dodge the midnight trap.
SQL SERVER – Time Delay While Running T-SQL Query – WAITFOR Introduction
WAITFOR makes a T-SQL batch pause for a set time, or until a clock time, before the next statement runs. I show both uses with small examples.
Rolling Date Ranges Forward Without Hard-Coded Years
Replace hard-coded years with indexed date ranges for current periods, full months, year-to-date comparisons, and any requested year.







