以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  用代码写表达式  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=70024)

--  作者:baixiaobai
--  发布时间:2015/6/14 21:09:00
--  用代码写表达式

If e.DataCol.Name ="消费金额" Then
   If e.DataRow.IsNull("消费金额") Then \'身份证号码是否为空
Else
   e.DataRow("应收") = e.DataRow("消费金额") * (1 - IsNull([折扣],0))
End If
End If

 

麻烦谁帮我改下红字的表达式··用代码的话改怎么写呀···


--  作者:blsu33
--  发布时间:2015/6/14 22:28:00
--  

IIF(expression, TrueValue, FalseValue)

 e.DataRow("应收") = e.DataRow("消费金额") * (1 - iif(e.DataRow.IsNull("折扣"),[折扣],0))


试试看


--  作者:大红袍
--  发布时间:2015/6/15 9:10:00
--  

 

 

[此贴子已经被作者于2015/6/15 9:10:20编辑过]

--  作者:大红袍
--  发布时间:2015/6/15 9:11:00
--  
If e.DataCol.Name ="消费金额" Then
    If e.DataRow.IsNull("消费金额") = False Then \'身份证号码是否为空
        e.DataRow("应收") = e.DataRow("消费金额") * (1 - e.DataRow("折扣"))
    Else
        e.DataRow("应收") = Nothing
    End If
End If