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

Appending Null Data to DateTime Field

Status
Not open for further replies.

LearningSql

Programmer
Apr 16, 2002
48
US
Hello all -- thanks for your assistance on this one.

I am trying to Append data from Table A to Table B. The data from Table A is a Null value. The field the Null value is appending to in Table B is a DateTime datatype.

=============================================
Example:
A.ShortDateData -> B.DateTimeData
Null -> 1901-01-01 00:00:00.000
=============================================

What is coming out is the default 1901-01-01 00:00:00.000.
What am I doing wrong? I just need the Null value to be appended. The field is set up to accept Null values.

Any and all thoughts are appreciated -- I seem to have missed the boat on this one somewhere.

Thanks again.
LearningSql
 
It looks like your insert is seeing the NULL date as a BLANK. Can you do a select to verify that your insert date does indeed appear as a NULL? Another alternative is run an update and set all 1901-01-01 00:00:00.000 dates to NULL.

Hope this helps.
 
Hey there MeanGrean.

I've written the script to change the dates from default to NULL. I'd rather not do it this way as I need to update about 20 fields in 2 tables.

I'll check the Select to verify if it is reading BLANKS instead of NULL.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top