Playing with Datetime became a puzzle when one conversion worked for a customer but failed for me. The input was unchanged.
SQL SERVER – Find Week of the Year Using DatePart Function
The DATEPART function returns a week number according to its week definition. I choose that convention before using calendar logic.
SQL SERVER 2016 – STRING_SPLIT Function Performance Comparison – Notes from the Field #118
Splitting strings once meant temp tables or CROSS APPLY. In Notes from the Field #118, Kathi Kellenberger compares STRING_SPLIT performance in SQL Server 2016.
Interview Question of the Week #046 – How @@DATEFIRST and SET DATEFIRST Are Related?
How are @@DATEFIRST and SET DATEFIRST related? One sets the first day of the week for your session, the other reads it back, and language matters too.
Why datetime Turns .999 Milliseconds Into the Next Day
See why 999 milliseconds rounds into tomorrow with datetime, compare datetime2 precision, and use an exclusive next-day report boundary.
SQL SERVER – Adding Datetime and Time Values Using Variables
Adding a time variable to a datetime variable throws Msg 402. The fix is to CAST the time to datetime first. Examples of adding datetime and time values.
SQL SERVER – Finding If Date is Last Day of the Month
Did an employee join on the last day of the month? I show the add one day trick and the EOMONTH function from SQL Server 2012 to check it.







