SQL Server FORMAT returns NULL for TIME but not DATETIME
Summary A developer encountered a critical discrepancy in how the FORMAT() function in SQL Server 2022 handles different temporal data types. When attempting to apply a custom format string (h:mmt) to a TIME data type, the function returns NULL, whereas the same format string applied to a DATETIME type returns a valid string. This behavior … Read more