I am still having my nullable smalldatetime fields displaying as 1/1/1900. I have many date fields that I don't want anything in. This is on a web based form with asp. I am not sure what to type or where.
When inserting into the database the values submitted by the form. Force to insert null when the date field submitted on the form is empty. Something like this:
If request("mydate")="" Then
SQL= Insert Into Tablename(MYdate) Values (NULL)
Else
SQL= Insert Into Tablename(MYdate) Values ('"&request("mydate")&"')
End if
Then you will have NULL entered in the database instead of the default value 1/1/1990
datetimes are held as number of days from 1 jan 1900. You are inserting 0 into the field instead of null.
In your asp code you are sending 0 to the database instead of null. You either need to change the asp code to send a null or when you retrive data display 1 jan 1900 as blank.
Almost certainly not a problem with sql server.
======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.