DataDeveloper (8/28/2014)
I had the same issue pulling data into SQL Server from an AS400 server using OPENQUERY via a linked server. Try the following Syntax... it solved my problem. My issue involved date fields hence the date string. The key is using the NULLIF AS400 function in the OPENQUERY SQL.SELECT NULL_COLUMN AS ALIAS_NAME
FROM OPENQUERY([LINKED_SERVER_NAME],'SELECT NULLIF(NULL_COLUMN,''0001-01-01'') AS NULL_COLUMN
FROM CATALOG.LIBRARY.TABLE');
<Face palm><Multiple head-desk> BWAAA-HAAA!!! Sometimes the simplest solutions are overlooked. Thanks, double D!
--Jeff Moden
Change is inevitable... Change for the better is not.