DATETIMEOFFSETFROMPARTS constructs a local clock with an explicit offset. Keep both component signs consistent and validate the complete input.
SQL SERVER – Interview Questions and Answers – Part 6
Part 6 of my SQL Server Interview questions and answers covers SQL Server 2008, starting with what the master, msdb, model, tempdb and resource databases do.
SQL SERVER – Few Useful DateTime Functions to Find Specific Dates
Useful DateTime functions from Vivek Jamwal: find today, yesterday, and the first and last day of the current or last week and month with DATEADD.
Stable Weekday Numbers Without Changing DATEFIRST
Stable weekday numbers use a fixed Monday anchor and negative-safe modulo. Map Monday to one without changing DATEFIRST or session language.
Year-to-Date Totals Next to the Same Period Last Year
A fair year-to-date comparison needs the same dates from last year. Here is a short query, plus the leap day trap.
SQL SERVER – 2008 – Get Current System Date Time
Several ways to get the current system date time in SQL Server 2008, from GETDATE to the newer functions, with a quick video on the topic.
SQL SERVER – 2008 – Find Current System Date Time and Time Offset
SQL Server 2008 adds SYSDATETIMEOFFSET, which returns the current system date time along with its time offset from GMT. One line shows how.







