简体   繁体   中英

SSRS Expressions query - SQL Server Report Builder

I am creating a table and I am doing a custom count for each of the columns to say how many times the value was used, I am using the formula below and it is working

=Sum(Microsoft.VisualBasic.Interaction.IIF(Fields!erromsg.Value.Contains("1.5"), 1, 0))

The column I am having a problem with is where I want it to do a sum for values that DO NOT contain the any of the numbers eg

=Sum(Microsoft.VisualBasic.Interaction.IIF(Fields!erromsg.Value.NOTContains("1.5","1.6"), 1, 0))

I am guessing the NOTContains is not correct and need to identify the correct command and also I am not sure if the multiple option is in the correct format.

For not contains you can use the following Iif expression

=SUM(
    Iif(
        Fields!errormessage.Value.Contains("1.5") OR
        Fields!errormessage.Value.Contains("1.6"), 
        0,
        1
    )
)

在此处输入图像描述

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM