Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/14.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

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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.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
Vba 如何在SSRS中删除小数点后的零作为表达式_Vba_Reporting Services_Ssrs 2008 R2_Ssrs Expression - Fatal编程技术网

Vba 如何在SSRS中删除小数点后的零作为表达式

Vba 如何在SSRS中删除小数点后的零作为表达式,vba,reporting-services,ssrs-2008-r2,ssrs-expression,Vba,Reporting Services,Ssrs 2008 R2,Ssrs Expression,我在SSRS报告中的一个文本框中有以下表达式: =IIF(IsNothing(Lookup(Trim(Fields!venta_Cod_vendedor.Value) & "-" & ReportItems!Textbox233.Value, Fields!AgregarVentas.Value, Fields!venta_prom_sem.Value, "EfectividadDeFrecuencias_Ventas")) = True ,"0" ,IIF(Lookup(T

我在SSRS报告中的一个文本框中有以下表达式:

=IIF(IsNothing(Lookup(Trim(Fields!venta_Cod_vendedor.Value) & "-" & ReportItems!Textbox233.Value, Fields!AgregarVentas.Value, Fields!venta_prom_sem.Value, "EfectividadDeFrecuencias_Ventas")) = True

,"0"

,IIF(Lookup(Trim(Fields!venta_Cod_vendedor.Value) & "-" & ReportItems!Textbox233.Value, Fields!Agregar.Value, Fields!total_cant_pos.Value, "EfectividadDeFrecuencias_Total") <> "0"

,FormatNumber(Lookup(Trim(Fields!venta_Cod_vendedor.Value) & "-" & ReportItems!Textbox233.Value, Fields!AgregarVentas.Value, Fields!venta_frecuencia.Value, "EfectividadDeFrecuencias_Ventas")
/ Lookup(Trim(Fields!venta_Cod_vendedor.Value) & "-" & ReportItems!Textbox233.Value, Fields!Agregar.Value, Fields!total_cant_pos.Value, "EfectividadDeFrecuencias_Total"),2)

,"0"))
因此,这将给我:

正如你所看到的,如果我使用一个格式编号,1.3将转换为1,30,这将是错误的,与1(1,00)相同。现在1339…etc会给我1,34,这很好

但是检查1.065,FormatNumber会给我1.07而不是1.06

所以问题是,我如何将我的数字格式化为小数点后的最后一个非零数字,如果(在本例中)第三个值是5,而不是1.07是1.06,则选择较低的值。我想如果我使用天花板或地板,它会给我一个整数部分。

试试这个:

=ROUND(1.339,2,MidpointRounding.ToEven)
这将给出:
1.34

给出:
1.06


让我知道这是否有用。

将数字乘以100,然后使用floor除以100?非常好!,除了1339 etc会给我1.33而不是1.34,你想在哪一点上升?正常情况下,分界是,005,你想要,0051还是,006?如果我抓住地板(1.33913043478261*100)/100会给我1.33,而不是1.34,可能会使用某种形式的表达式将数字四舍五入?到目前为止,我有:
Floor(Lookup(Trim(Fields!venta_Cod_vendedor.Value)&“-”和ReportItems!Textbox221.Value,Fields!AgregarVentas.Value,Fields!venta_frecuencia.Value,“efectividaddfrecuencias_Ventas”)/Lookup(Trim(Fields!venta_Cod_vendedor.Value)&“-”和ReportItems!Textbox221.Value,Fields!Agregar.Value,Fields,Fields!Fields!字段!total_pos.Value,“effectividaddfrecuencias_Total”)*100)/100
这将四舍五入到1.06,但这不是1.075到1.08吗?这可能是OP想要的,我只是想澄清一下。你是对的@ScottCraner。它四舍五入到最近的偶数。
=ROUND(1.339,2,MidpointRounding.ToEven)
=ROUND(1.065,2,MidpointRounding.ToEven)