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

Default value 1/1/1900 I don't want 1

Status
Not open for further replies.

krizsy

Technical User
Apr 28, 2004
11
US
In my sql database all my nullable dates are getting 1/1/1900 inserted. I don't want this. I am using a web based form with asp. How do I change this default. I am just learning and can't quite get things to work right. thanks
 
It's because you are putting 0 instead of null in the field.

A datetime is held as the number of days from 1 jan 1900 so 0 will give you that date.

======================================
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.
 
I'm not entering anything at all. In the EM I can't even type in a default value. I would like to leave it blank but can't.
 
In the EM I can't even type in a default value
Why not? When you highlight the column in "Design Table" you can put a default value in the bottom table. Is it nullable?

INSERT myTable (field1, dateField) VALUES ('some text',null)

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top