Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTime Fields - 1/1/1900 base date problem

Status
Not open for further replies.

VBGuy2112

Programmer
Feb 19, 2002
58
US
I have a few datetime fields from a SQL server database that I'm updating through a web page. My problem is that if the field is being cleared out during an update changed from say "10/12/2000" to "", the date defaults in the database to 1/1/1900. Is there any way to have a date and time field allow a zero-length string? If I clear out a datetime field in the SQL Server environment, I get the error "The value you entered is not consistant with the data type or length of the column".

"If you've bitten off more than you can chew, chew faster"
 
The update query would be something like this

UPDATE tablename
SET columnName = NULL

Of course you should put a where clause here if you don't want to update the whole table
 
Excellent!!

Thank you for the quick responses.

VBGUY2112
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top