gpt4 book ai didi

mysql - SSRL 表达式抛出错误

转载 作者:行者123 更新时间:2023-11-29 06:56:53 25 4
gpt4 key购买 nike

如果值为 0,则为 0,否则运行 switch 语句 无论如何它都会返回 Nil 。请帮忙

    =IIf(Fields!SpecialOvtHrs.Value>0,IIf(Fields!cfgCurrencySymbol.Value="OMR",Format(Fields!OvtPay.Value*Fields!ExchangeRate.Value / Fields!OvtHrs.Value,"#,##0.000"),
IIf(Fields!cfgCurrencySymbol.Value="BHD",Format(Fields!OvtPay.Value*Fields!ExchangeRate.Value / Fields!OvtHrs.Value,"#,##0.000"),
IIf(Fields!cfgCurrencySymbol.Value="AED",Format(Fields!OvtPay.Value*Fields!ExchangeRate.Value / Fields!OvtHrs.Value,"#,##0.00"),
IIf(Fields!cfgCurrencySymbol.Value="KWD",Format(Fields!OvtPay.Value / Fields!OvtHrs.Value *1,"#,##0.000"),
IIf(Fields!cfgCurrencySymbol.Value="JOD",Format(Fields!OvtPay.Value*Fields!ExchangeRate.Value / Fields!OvtHrs.Value,"#,##0.00"),
IIf(Fields!cfgCurrencySymbol.Value="QAR",Format(Fields!OvtPay.Value*Fields!ExchangeRate.Value / Fields!OvtHrs.Value,"#,##0.00"),
IIf(Fields!cfgCurrencySymbol.Value="SAR",Format(Fields!OvtPay.Value*Fields!ExchangeRate.Value / Fields!OvtHrs.Value,"#,##0.00"),"Nill"))))))),"Nill")


=Switch(Fields!SpecialOvtHrs.Value=0,0,

Fields!cfgCurrencySymbol.Value="OMR",Format(Fields!OvtPay.ValueFields!ExchangeRate.Value,"#,##0.000"),
Fields!cfgCurrencySymbol.Value="OMR",Format(Fields!OvtPay.Value
Fields!ExchangeRate.Value,"#,##0.000"), Fields!cfgCurrencySymbol.Value="BHD",Format(Fields!OvtPay.ValueFields!ExchangeRate.Value,"#,##0.000"), Fields!cfgCurrencySymbol.Value="AED",Format(Fields!OvtPay.ValueFields!ExchangeRate.Value,"#,##0.00"), Fields!cfgCurrencySymbol.Value="KWD",Format(Fields!OvtPay.Value*1,"#,##0.000"), Fields!cfgCurrencySymbol.Value="JOD",Format(Fields!OvtPay.ValueFields!ExchangeRate.Value,"#,##0.00"), Fields!cfgCurrencySymbol.Value="QAR",Format(Fields!OvtPay.ValueFields!ExchangeRate.Value,"#,##0.00"), Fields!cfgCurrencySymbol.Value="SAR",Format(Fields!OvtPay.Value*Fields!ExchangeRate.Value,"#,##0.00"))。

最佳答案

尝试以下 SWITCH 语句。

=SWITCH(
Fields!SpecialOvtHrs.Value <=0 , "Nill",
Fields!cfgCurrencySymbol.Value="OMR", Format(Fields!OvtPay.Value*Fields!ExchangeRate.Value / Fields!OvtHrs.Value,"#,##0.000"),
Fields!cfgCurrencySymbol.Value="BHD", Format(Fields!OvtPay.Value*Fields!ExchangeRate.Value / Fields!OvtHrs.Value,"#,##0.000"),
Fields!cfgCurrencySymbol.Value="AED", Format(Fields!OvtPay.Value*Fields!ExchangeRate.Value / Fields!OvtHrs.Value,"#,##0.00"),
Fields!cfgCurrencySymbol.Value="KWD", Format(Fields!OvtPay.Value / Fields!OvtHrs.Value *1,"#,##0.000"),
Fields!cfgCurrencySymbol.Value="JOD", Format(Fields!OvtPay.Value*Fields!ExchangeRate.Value / Fields!OvtHrs.Value,"#,##0.00"),
Fields!cfgCurrencySymbol.Value="QAR", Format(Fields!OvtPay.Value*Fields!ExchangeRate.Value / Fields!OvtHrs.Value,"#,##0.00"),
Fields!cfgCurrencySymbol.Value="SAR", Format(Fields!OvtPay.Value*Fields!ExchangeRate.Value / Fields!OvtHrs.Value,"#,##0.00"),
True, "No match")

需要考虑的其他(可选)事项..

  • 在数据库中存储针对您货币的小单位数量(例如“OMR”为 3)。
  • 存储对本地货币“KWD”的汇率 1,这样您就可以对所有实例使用相同的计算,并且无需在此时对其进行格式化。
  • 在单元格的格式属性中使用小单位,例如 ="n"& Fields!MinorUnits.Value 这会导致 OMR 为“n3”)

关于mysql - SSRL 表达式抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45213591/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com