dt.Columns.Add("Elec_Product_Value", typeof(double), " IIF(ProductYield is not null and ProductYield>0 and Elec_Value is not null, Convert(Elec_Value/ProductYield*10000,'System.Int64')/10000, null)");
dt.Columns.Add("Water_Product_Value", typeof(double), " IIF(ProductYield is not null and ProductYield>0 and Water_Value is not null, Convert(Water_Value/ProductYield*10000,'System.Int64')/10000, null)");
dt.Columns.Add("Steam_Product_Value", typeof(double), " IIF(ProductYield is not null and ProductYield>0 and Steam_Value is not null, Convert(Steam_Value/ProductYield*10000,'System.Int64')/10000, null)");
dt.Columns.Add("CA_Product_Value", typeof(double), " IIF(ProductYield is not null and ProductYield>0 and CA_Value is not null, Convert(CA_Value/ProductYield*10000,'System.Int64')/10000, null)");
dt.Columns.Add("WasteWater_Product_Value", typeof(double), " IIF(ProductYield is not null and ProductYield>0 and WasteWater_Value is not null, Convert(WasteWater_Value/ProductYield*10000,'System.Int64')/10000, null)");
其中:表達式中可以使用IIF(條件,表達式1,表達式2)三元運算符,使用Convert(Elec_Value/ProductYield*10000,'System.Int64')/10000進行保留4位小數位數