Show Date and Time as Blank instead of 1900-01-01 - SQL Server

← PrevNext →

Last updated: 05th November 2026

In SQL Server, the DATE and DATETIME data types are commonly used to store date and time values in database tables. However, one common issue developers encounter is the unintended use of the default date 1900-01-01, which can result in misleading or inaccurate information. When displayed in reports, applications, or user interfaces, this placeholder date may be mistaken for a legitimate value. To prevent such confusion, it is better to use NULL when no valid date has been provided. This clearly indicates the absence of a date value and helps maintain clean, accurate, and meaningful data throughout the application.

Example:

Let's create a table and insert some values in it. The table has 4 columns. The last column is "datetime". See the image below.

CREATE TABLE Product_List (
    ProdCode int NOT NULL,
    Product varchar(50) NULL,
    DateEdited datetime NULL,
) 

INSERT INTO Product_List (ProdCode, Product) VALUES (1, 'BOOKS')
SELECT *FROM Product_List

NULL value in datetime Column

The Product_List table contains "three" columns, one of which is defined using the DATETIME data type. As shown in the "INSERT" statement above, when no value is provided for the DateEdited column during data insertion, SQL Server automatically assigns a NULL value. This behavior is due to the column being explicitly configured with DEFAULT NULL when the table was created.

Using NULL instead of a placeholder date such as 1900-01-01 ensures that the absence of a date is represented accurately, avoiding confusion when the data is retrieved or displayed in reports and applications.

Value as Blank

Occasionally, developers try to push a blank value in the date column, which results in translating and inserting a 1900-01-01 00:00:00. An empty string (''), represented by two single quotation marks with no value between them, is generally used with character-based data types such as VARCHAR and CHAR. However, it is not a valid empty value for DATE or DATETIME columns. These data types expect a valid date or datetime value, or NULL to represent the absence of a date. For example:

INSERT INTO Product_List (ProdCode, Product, DateEdited) VALUES (1, 'BOOKS', '')
SELECT *FROM dbo.Product_List

date time showing 1900-01-01

Since we cannot insert a blank value in place of "1900-01-01", we can use a workaround to display a blank value instead of an outdated date. We will write a simple query to convert 1900-01-01 into a more meaningful value.

👉 Now that we understand how the date 1900-01-01 ended up in our SQL Server table, let's explore how to display date and time values as blank instead of showing the misleading placeholder date 1900-01-01.

SQL Query to Show Date and Time as Blank instead of 1900-01-01

SELECT DateEdited = 
    CASE WHEN DateEdited = '1900-01-01 00:00:00.000' THEN '' 
    ELSE CONVERT(VARCHAR(10), DateEdited, 103) 
    END
FROM Product_List

-- The output is a blank (or empty string) instead of NULL if the column has 1900-01-01 00:00:00.000 

The query converts the date to a string value. The CONVERT() function will translate the value in a string format. As mentioned earlier, blank ('') (or empty string) are valid in string-based data types like VARCHAR, making this technique useful for displaying a blank instead of misleading or default dates within user-facing applications.

Conclusion

This workaround provides a practical way to control how blank dates are displayed, particularly when dealing with legacy or placeholder values such as 1900-01-01. Although it is not a perfect solution, it helps prevent misleading or irrelevant date values from being displayed to end users. By converting date values into string representations for display purposes, developers gain greater flexibility and control over how dates appear in reports, applications, and user interfaces.

However, it is important to remember that NULL and 1900-01-01 are not interchangeable. NULL represents the absence of a date, whereas 1900-01-01 is an actual date value that may have been introduced through default constraints, implicit conversions, or application logic. Since DATE and DATETIME are non-character data types, date values should be handled carefully, with appropriate separation between data storage and presentation logic. This ensures better data accuracy, consistency, and clarity across applications.

← PreviousNext →