To get the current timestamp in Python, import datetime, call now and format the result with strftime. This post prints the same date and time in Python and in T-SQL, compares the two clocks, and shows how to ask for UTC in both.
SQL SERVER – Find Business Days Between Dates
Business Days Between Dates require a defined calendar and endpoint rule. This example counts inclusive Monday-to-Friday dates for July 2021.
SQL SERVER – Display Dates in Different cultures FORMAT
Today we are going to learn a very simple and interesting concept used very little. It is about how to Display Dates in Different cultures FORMAT.
Convert Empty String to NULL Date in SQL Server: Use NULLIF
To convert empty string to NULL in a date column, wrap the text in NULLIF before you cast it. A plain CAST returns 1900-01-01 and hides the problem. This post tests five expressions on six text values, including a real 1900 date, a run of spaces and a tab, and shows which ones stay correct.
AT TIME ZONE Twice: Convert UTC to Local Time in SQL Server
AT TIME ZONE twice converts UTC to local time in SQL Server. The first use labels a plain value as UTC and the second converts it. A demo shows the common one step mistake, stores in three cities, and the missing and repeated hours of daylight saving.
Running Totals That Reset Every Month
Calculate running totals that reset by calendar month, customer, or fiscal period, using stable ordering and explicit ROWS frames.
Generate a Date Range: List All Dates Between Two Dates
To generate a date range in SQL Server, number the days between a start date and an end date and add each number to the start. This post shows a recursive CTE, its limit of 100 recursions, GENERATE_SERIES, a version for older servers, and how to handle times and missing days.






