Ask Your Question
2

Why does a comparison with a NULL date result in a NULL value in SQL Server?

asked 2022-05-15 11:00:00 +0000

pufferfish gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-06-11 16:00:00 +0000

huitzilopochtli gravatar image

In SQL Server, NULL represents an unknown or missing value. When a comparison operation is performed between a non-NULL value and a NULL value, the result is always NULL. This is because the comparison cannot determine the relationship between the non-NULL value and the unknown/missing value represented by NULL. Therefore, when a comparison is made with a NULL date, the result is always NULL.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-05-15 11:00:00 +0000

Seen: 1 times

Last updated: Jun 11 '22