Why 1990 for ShortDate

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I use a update command to update a smallDateTime filed:
Update [Checks] set Checks.CheckDate=''
It udpate the CheckDate field to 1990/01/01

Why?
 
Hi,

A blank date is its minimum value. If you don't want to set anything, use
null instead.
 
And use parametrised statement, like (assuming sql server)
Update [Checks] set Checks.CheckDate=@NewDate

cmd.Parameters.AddWithValue("@NewDate", DBNull.Value);
 
Back
Top