Avatar of aneilg
aneilg
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

SSRS Expression

i have the following expression.
=Switch(
      fields!PercentFlag.Value ="H", format(fields!Time.Value, "HH:mm"),
      ((Fields!PercentFlag.Value ="Y")AND (Fields!Value.Value >0)), Format(Sum(Fields!Value.Value * 100), "0.0"),
      True, Replace(cStr(Sum(Fields!Value.Value)),".0","")
)

produces 026369797987998

but when i take out

AND (Fields!Value.Value >0))

so i am left with

=Switch(
      fields!PercentFlag.Value ="H", format(fields!Time.Value, "HH:mm"),
      ((Fields!PercentFlag.Value ="Y")), Format(Sum(Fields!Value.Value * 100), "0.0"),
      True, Replace(cStr(Sum(Fields!Value.Value)),".0","")
)

i get 2.7. but if the value = 0 i get 0.0.

why does my first expression does not work.
Microsoft SQL Server 2008

Avatar of undefined
Last Comment
aneilg

8/22/2022 - Mon