简体   繁体   English

如何治疗空细胞

[英]how to treat empty cells

I am using SQL Server and I have a manager that just left. 我正在使用SQL Server,并且还有一个经理刚离开。 When I pull the record for sales, the section that shows the manager's name is empty for that team's orders. 当我提取销售记录时,显示经理姓名的部分对于该团队的订单为空。 How can I make it so it shows the word OPEN when that happens? 我怎样才能做到这一点呢?

I tried 我试过了

Select
    Sales_Rep_Name,
    isnull([manager_name],'open') As [Manager Name]
From 
    Salestable

but it didn't work. 但这没用。 I also tried a case 我也试过了

Select
    Sales_Rep_Name,
    case    
       when [MANAGER_NAME] is null 
          then 'open'
          else [MANAGER_NAME]
    end as [Manager Name]
From
    SalesTable

The query works but the cells still show empty. 查询有效,但单元格仍显示为空。 Is there anything I am doing wrong? 我做错了什么吗? Thanks 谢谢

@jnevill & Evan I just verified that the cell actually has a space. @jnevill&Evan我刚刚验证了单元格实际上有一个空格。 I switched the case to = ' ' and it works now. 我将大小写切换为='',现在可以使用了。 Thank you guys. 感谢大伙们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM