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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Datetime

Status
Not open for further replies.

ProgrammerAndy

Programmer
Nov 15, 2000
3
0
0
US
I have an ASP page with an input field that will input a date. In my SQL 7.0 database i allows NULLS in my field that is set to datatype datetime. But when i do an INSERT or an UPDATE to the database, and this input field is left blank, it automatically in inserting the date 1/1/1900. Does anyone know how to stop this from happening?

This is my code on Add page:
<TD><font face=&quot;arial&quot; size=2>Followup Date:</font></TD>
<TD><input type = &quot;text&quot; name=&quot;InputFollowUpDate&quot; size=10 value=&quot;&quot;></TD>

ANY/ALL help apreciate!
 
You need to specifically insert NULL instead of leaving it blank. I would bet that you have that database column set to some default, which is where you're getting this 1/1/1900 business.

insert into myTable (myIDColumn, myDateTimeColumn) values (1, NULL)



Monte Kalisch
montek@montekcs.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top