Null dates and 1900-01-01 and sql server 2008
Posted on 2010-08-28
We have upgraded Sql Server 2005 to Sql Server 2008.
Date values for a particular variable now display 1900-01-01 when the date is null.
The variable is declared in this way:
Let $Activity_Date = &B.LAST_ACTIVITY_DATE
When I tests for nulls,
let #value_null= ISNULL($Activity_Date)
if #value_null= 1
#DEBUG SHOW '************$Activity_Date here' $Activity_Date
In the trace file, I see that the value is null, yet in sql server when this value is inserted into a table it displays as 1900-01-01. I want this to display this as a blank.
I know that a vaule that is 0 or ' ' will display as 1900-01-01 but I clearly can see that the value is null ,
What cast statment can I use in the insert to avoid this.