我有以下案例陈述;
case when (
CASE
WHEN datediff(year,view_3.[PERSON BIRTH DATE], @ReportPeriodStartDate) >= 19 AND view_3.[NI NUMBER] IS NOT NULL
THEN '' ELSE view_3.[NI NUMBER] END ) = 0 then '' else view_3.[NI NUMBER] END AS [NI NUMBER],
我想把它还回去
Birthddate NI Number
14/04/2012 9000
06/05/2020 2000
01/01/2001
22/12/1998
但我得到的结果是;
Birthddate NI Number
14/04/2012 9000
06/05/2020 2000
01/01/2001 0
22/12/1998 0
我不要零,我要空字符串。
1条答案
按热度按时间soat7uwm1#
您想要返回一个字符串,因此需要将
else
: