ds.Tables["Differences"].Columns.Add("Ping", typeof(decimal),
"CASE WHEN((isnull(Yuliu,0)+isnull(Sent,0)+isnull(Amount,0))<0) THEN ABS((isnull(Yuliu,0)+isnull(Sent,0)+isnull(Amount,0))) ELSE 0 END AS Ping");具體就是想實現這樣一個功能.但現在語句有問題,,,
高手請支招
"CASE WHEN((isnull(Yuliu,0)+isnull(Sent,0)+isnull(Amount,0))<0) THEN ABS((isnull(Yuliu,0)+isnull(Sent,0)+isnull(Amount,0))) ELSE 0 END AS Ping");具體就是想實現這樣一個功能.但現在語句有問題,,,
高手請支招
解决方案 »
- 如何在form窗体中嵌入新打开的窗体??
- 能不能在中括号内匹配多个字符串?。。。
- 谁能给我举例说明回调函数的使用呢?
- 很急..一分钟就刷..请大家帮忙...
- 去掉字符串前面的0?
- 关于在C#程序里怎么样加入声音?
- 有没有一种软件可以在后台记录什么时间删除了什么文件?(非C#问题)
- 大量文本
- 【求教】经验公式为Qg=a*X^b,如何根据实测值回归得到a,b?
- c#&win98
- Help:如何同時打開兩個Excel工作簿?謝謝
- 在线等 。。。。。。。。。。。。。但发布以后就有问题了 大家帮忙看看啊,这样的错误是因为什么WWW.315XXG.COM ,是不是因为我的空间是。net1.0的??????????
第一条增加一个列,
第二条用case语句去update此列~~~
else用来干嘛的,语句根本就不完整啊,建议到查询分析器里面建个跟ds.Tables["Differences"]一样的表,先吧sql编过了
CASE WHEN((isnull(Yuliu,0)+isnull(Sent,0)+isnull(Amount,0)) <0) THEN ABS((isnull(Yuliu,0)+isnull(Sent,0)+isnull(Amount,0))) ELSE 0 END
我暈...else用來判斷反之的啊
這句難道有錯...
我sql编过了的
这样好看些
ds.Tables["Differences"].Columns.Add("Ping", typeof(decimal),
"CASE WHEN((isnull(Yuliu,0)+isnull(Sent,0)+isnull(Amount,0)) <0) THEN ABS((isnull(Yuliu,0)+isnull(Sent,0)+isnull(Amount,0))) ELSE 0 END AS Ping");
CASE WHEN ( cast(isnull(Yuliu,0) as int )+ cast(isnull(Sent,0) as int)+cast(isnull(Amount,0) as int)) <0 THEN ABS(( cast(isnull(Yuliu,0) as int )+ cast(isnull(Sent,0) as int)+cast(isnull(Amount,0) as int))) ELSE 0 END AS Ping")