如何确保PCTofSales不是0。
'gets the projected sales by dividing the currentsales by the percent of sales
Dim projectedye As New DataColumn
projectedye = New DataColumn("ProjSales", GetType(Double))
projectedye.Expression = "CurrentSales / (PCTofSales)"
答案 0 :(得分:2)
假设您使用的是.NET 3.5:
pctofsales.Expression = "IIF([YEsales] = 0, 0, [ASOFSales] / [YEsales])"
请参阅此处:MSDN's article,了解有关可在表达式中使用的函数的信息。
答案 1 :(得分:0)
在以下情况下,您是否可以使用IF THEN来调用该功能:
“[ASOFSales] / [YEsales]”
等于零还是不适合划分?
答案 2 :(得分:0)
对数据集运行更新以将所有0更改为NULL或更改数据源以在PCTofSales /其他列中返回NULL而不是0。