NULL Values Involved in Datetime Operations in SQL Server

Q

What Happens If NULL Values Are Involved in Datetime Operations in SQL Server Transact-SQL?

✍: FYIcenter.com

A

If NULL values are involved in datetime operations, the result will be datetime NULL values. The following tutorial script shows you some good examples:

USE FyiCenterData;
GO

SELECT GETDATE()+NULL;
GO
-----------
NULL

SELECT DATEDIFF(DAY, GETDATE(), NULL);
GO
-----------
NULL

 

NULL Values Involved in Bitwise Operations in SQL Server

NULL Values Involved in String Operations in SQL Server

Working with NULL Values in SQL Server Transact-SQL

⇑⇑ SQL Server Transact-SQL Tutorials

2017-02-05, 1521🔥, 0💬