According to the doc the default value of a date in SQL Server is
1900-01-01 00:00:00
Can I call the default value in any way? For instance like this
select isnull(date_column, default(date_column))
from my_table
Perhaps:
SELECT DefaultDate = CAST(0 AS DATETIME)
sql-Fiddle
If you need a DATE you can cast it also:
SELECT DefaultDate = CAST(CAST(0 AS DATETIME) AS DATE)
sql-fiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With