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.
Running Start Times: Build an Agenda With SQL
Running start times depend on the durations that precede each activity. Use ordered window sums while retaining full dates and explicit end boundaries.
SQL SERVER – Retrieve – Select Only Date Part From DateTime – Best Practice – Part 2
Which way to select only date part from DATETIME is faster? After more tests on large tables, I now suggest the DATEADD and DATEDIFF method over CONVERT.
SWITCHOFFSET Versus TODATETIMEOFFSET: Two Offset Operations
SWITCHOFFSET versus TODATETIMEOFFSET depends on the input contract. Preserve a known instant or attach an offset to a genuinely local clock.







