Convert ‘smalldatetime’ to ‘date’ in SQL Server (T-SQL Examples)

This article contains examples of converting a smalldatetime value to a date value in SQL Server.

One of the benefits of converting a smalldatetime value to date is that you reduce the storage size down from 4 bytes to 3 bytes. However, you do lose the time component from the value, so you would only do this conversion if you don’t need the time.

The smalldatetime data type both the date and time. Its seconds component is always set to zero (:00), and it doesn’t have any fractional seconds. Its accuracy is to the nearest minute. Its storage size is 4 bytes.

The date data type on the other hand, only includes the date. Its accuracy is to the nearest day. Its storage size is 3 bytes.

So to be clear, when you convert a smalldatetime value to date, the year, month, and day are copied. The time is not copied.

Example 1 – Implicit Conversion

Here’s an example of an implicit conversion between smalldatetime and date.

DECLARE 
  @thesmalldatetime smalldatetime,
  @thedate date;
SET @thesmalldatetime = '2025-05-21 10:15:30';
SET @thedate = @thesmalldatetime;
SELECT 
  @thesmalldatetime AS 'smalldatetime',
  @thedate AS 'thedate';

Result:

+---------------------+------------+
| smalldatetime       | thedate    |
|---------------------+------------|
| 2025-05-21 10:16:00 | 2025-05-21 |
+---------------------+------------+

This is an implicit conversion because we’re not using a conversion function (like the ones below) to explicitly convert it. In this case, SQL Server performs an implicit conversion behind the scenes when we try to assign the smalldatetime value to a date variable.

In this example we can see that the date portion of the smalldatetime value is copied to the date value, and that the time is not copied.

Example 2 – Explicit Conversion using CAST()

Here’s an example of an explicit conversion. In this case, I use the CAST() function directly within the SELECT statement to explicitly convert between smalldatetime and date.

DECLARE @thesmalldatetime smalldatetime;
SET @thesmalldatetime = '2025-05-21 10:15:30';
SELECT 
  @thesmalldatetime AS 'thesmalldatetime',
  CAST(@thesmalldatetime AS date) AS 'date';

Result:

+---------------------+------------+
| thesmalldatetime    | date       |
|---------------------+------------|
| 2025-05-21 10:16:00 | 2025-05-21 |
+---------------------+------------+

Example 3 – Explicit Conversion using CONVERT()

Here’s an example of an explicit conversion using the CONVERT() function instead of CAST().

DECLARE @thesmalldatetime smalldatetime;
SET @thesmalldatetime = '2025-05-21 10:15:30';
SELECT 
  @thesmalldatetime AS 'thesmalldatetime',
  CONVERT(date, @thesmalldatetime) AS 'date';

Result:

+---------------------+------------+
| thesmalldatetime    | date       |
|---------------------+------------|
| 2025-05-21 10:16:00 | 2025-05-21 |
+---------------------+------------+