To complete the other answers, you have a good article on How to Search for Date and Time Values โโUsing SQL Server 2000
It reminds you of how date / time values โโare stored (two types of date and time data: date and time)
He also points out that Datetime and smalldatetime are similar to floating point, float and real data types in that they are approximate numbers. This means that the value obtained from SQL Server may be different from the value that was originally saved.
In addition, he warns database designers who do not always use date and time columns. During the creation of the database, each date / time column must be defined, whether it will store both dates and dates, only dates or times.
It closes with practical data / time requests .
You also have a good description of DATEADD and DATEDIFF here .
source share