SQLTeam.com | Weblogs | Forums

Cut and paste into Excel without the word "Null"


Here is my issue. Since I cast this line as a date, when it is null and pasted into excel, excel changes the cell to "1900-01-01" I just want it as an empty cell when pasted into excel. How do I get the results from the query to show nothing instead of "Null"?

,isnull(cast(wh.PRICED_DATE as DATE),'') as [Insp/Quote_Date]


Oddly enough, the empty string gets resolved to be a DATE since the first part of the ISNULL is a DATE. The date implied by an empty string is, you guessed it, '1900-01-01'. Perhaps the answer is to use CONVERT to change your date to a string. Then the null becomes a string and an empty one.


Thanks, I did that and it works.