开关功能不起作用 [英] Switch function not working
问题描述
你好!
我的表格中有一个文字字段 1.它们存储值1,0或空字符串。在我的报告中,我使用了以下的Switch语句,但对于所有空字符串,它显示的是N而不是" " ;.有人能告诉我我犯的是什么错误。
这是我的开关语句:= Nz(Switch([SW] = 1," y",[SW] = 0, " n"),"")
Joe
您的Nz支票Switch是否返回Null,情况绝对不是这样。您可以改为使用它:
Switch(IsNull([sw]),"",[sw] = 1," y",[sw] = 0," n")
或
Switch(IsNull([sw]),Null,[sw] = 1," y",[sw ] = 0," N")
Hello there!
I have a text fields in my table of size 1. They store a value 1, 0 or empty string. In my report I have used the following Switch statement but for all empty strings it displays N instead of " ". Can someone tell me what mistake I'm making.
Here is my switch statement: =Nz(Switch([SW]=1,"y",[SW]=0,"n")," ")
Joe
Your Nz checks whether Switch returns Null, which is never the case. You can use this instead:
Switch(IsNull([sw]),"",[sw]=1,"y",[sw]=0,"n")
or
Switch(IsNull([sw]),Null,[sw]=1,"y",[sw]=0,"n")
这篇关于开关功能不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!