Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services 在SSRS字段中包含或删除小数部分_Reporting Services_Ssrs 2008_Ssrs 2008 R2 - Fatal编程技术网

Reporting services 在SSRS字段中包含或删除小数部分

Reporting services 在SSRS字段中包含或删除小数部分,reporting-services,ssrs-2008,ssrs-2008-r2,Reporting Services,Ssrs 2008,Ssrs 2008 R2,我在SSRS报告中有一个数字字段。当前,此字段的属性设置为显示2位小数 如果值是整数,我需要进行更改以删除小数点 例如:如果数字为12.31,则SSRS字段上的输出应为12.31 如果数字为12.00,SSRS字段上的输出应为12 有人能帮我做这件事吗?表达式或字段属性?您可以对数据使用切换函数,将其转换为首选格式。在文本框属性的数字部分(tablix单元格等) =开关({your field}.value mod 1=0,0, {your field}.值mod 1 0,0.00) 如果我没

我在SSRS报告中有一个数字字段。当前,此字段的属性设置为显示2位小数

如果值是整数,我需要进行更改以删除小数点

例如:如果数字为12.31,则SSRS字段上的输出应为12.31

如果数字为12.00,SSRS字段上的输出应为12


有人能帮我做这件事吗?表达式或字段属性?

您可以对数据使用切换函数,将其转换为首选格式。在文本框属性的数字部分(tablix单元格等)

=开关({your field}.value mod 1=0,0,
{your field}.值mod 1 0,0.00)

如果我没有错,应该引用格式化代码。此外,当存在单一条件时,最好使用Iif以提高代码可读性。当存在多个条件时,Switch优于嵌套Iif。
=switch( {your field}.value mod 1 = 0 , 0,
         {your field}.value mod 1 <> 0, 0.00)