MS SQL Server Concepts and Programming Question:
Download Job Interview Questions and Answers PDF
What Happens If NULL Values Are Involved in Datetime Operations?
Answer:
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 GlobalGuideLineDatabase;
GO
SELECT GETDATE()+NULL;
GO
-----------
NULL
SELECT DATEDIFF(DAY, GETDATE(), NULL);
GO
-----------
NULL
USE GlobalGuideLineDatabase;
GO
SELECT GETDATE()+NULL;
GO
-----------
NULL
SELECT DATEDIFF(DAY, GETDATE(), NULL);
GO
-----------
NULL
Download MS SQL Server Interview Questions And Answers
PDF
Previous Question | Next Question |
What Happens If NULL Values Are Involved in String Operations? | What Happens If NULL Values Are Involved in Bitwise Operations? |