select  p.part_no as po ,p.in_Client as ref_id,convert(char(10), h.ok_date,20) as date_io,
          datediff(day,h.ok_date,getdate() ) as days ,case when datediff(day,h.ok_date,getdate() ) then  p.pn_in_stock else 0   end  as  Over_days From  msh_in_part p,msh_in_head h 
          where p.pro_id=h.pro_id   and h.in_job_id=p.in_job_id  and h.in_ok= 'Y' 
          and p.pn_in_stock > 0  and datediff(day,h.ok_date,getdate() )执行之后报‘消息 156,级别 15,状态 1,第 1 行
在关键字 'then' 附近有语法错误。’
各位帮忙看看了,case when .....then语句到底哪里用错 了,谢谢了...