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!

Append union query to table with null date value

Status
Not open for further replies.

DrSmyth

Technical User
Jul 16, 2003
557
GB
Hi, i'm appending a union query to another table, one part of the union query reports on a date field so will have a date value, the other part won't does not report on this field sop the value will always be null.

The problem i've got is with the part of the union query with no dates. I've used this line of SQL
Code:
 ,"" AS DateAllocated,
to generate a null date value but it's causing the row to be thrown out of the source table as it is not coming through as a date.

Does anybody know how i can create a null date value using SQL?
 
I used:
,Null,
Instead of:
,"" AS DateAllocated,
and it seemed to work.
 
So that would be
Code:
null as DateAllocated

I'll give it a go, cheers for the response
 
is not the same as null - "" is an empty length string, and will come up as not null.

Weirdly, a custom function set to return a Date value will return 0 rather than null if it is not set. The 0 will translate to 01/01/1899 !

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top