You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SSRS表达式如何合并价格列并将查询返回的NULL显示为空白

SSRS价格字段合并展示解决方案

1. 合并字段为带美元符号的指定格式

你可以直接使用SSRS内置的格式化函数完成需求,无需手动拼接符号,即可实现两个价格字段合并为$低价格 - $高价格的展示效果,同时保留你需要的4位小数。

2. NULL值返回空白处理

通过IsNothing函数判断字段是否为空,空值场景直接返回空字符串,即可避免出现$ - $的异常展示。

完整可用表达式

适配区域设置版本(默认输出美元符号)

=IIF(IsNothing(Fields!Price_Low.Value) OR IsNothing(Fields!Price_High.Value), "", FormatCurrency(Fields!Price_Low.Value, 4) & " - " & FormatCurrency(Fields!Price_High.Value, 4))

强制固定美元符号版本(不受服务器区域设置影响)

=IIF(IsNothing(Fields!Price_Low.Value) OR IsNothing(Fields!Price_High.Value), "", Format(Fields!Price_Low.Value, "$0.0000") & " - " & Format(Fields!Price_High.Value, "$0.0000"))

逻辑调整说明

如果仅需要在两个字段同时为NULL时才返回空白,把上述表达式判断条件中的OR替换为AND即可。

内容的提问来源于stack exchange,提问作者greggy paulin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.25 12:15:04