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

Copy NULL into a Date field

Status
Not open for further replies.

benjamenus

Programmer
Dec 3, 2001
157
GB
I am copying data from table 1 to table 2 (these exist in different databases). Table 2 has several extra fields where the data type is Date. This is the SQL

Copy from ...
Append t2
Using select t1.*
NULL as AdditionalDateField;

This produces a data type error, presumably because NULL is not in the appropriate format for AdditionalDateField. I've tried the following but still get an error.

NULL as to_date(AdditionalDateField)

Does anyone have any ideas please?
 
Sorry to waste your time, I found this answer for anyone interested:

to_date(NULL) as AdditionalDateField;

Easy when you know how!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top