我已經在我的查詢如下:合併datetime值,並轉換爲varchar
(case
when clientplans.start_date='1899-12-30 00:00:00.000' then ''
else CONVERT(varchar,clientplans.START_DATE,112)
end
) as POLICY_EFF_DATE,
我得到了一些空值,我需要凝聚爲空字符串。
我嘗試以下,其他的變化中,都沒有成功:
(case
when clientplans.start_date='1899-12-30 00:00:00.000' then ''
else COALESCE(CONVERT(varchar,clientplans.START_DATE,112) , '')
end
) as POLICY_EFF_DATE,
如何才能擺脫的NULL?
http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/09/bad-habits-to-kick-declaring-varchar-without-length.aspx – 2014-11-04 00:08:36