zoukankan
html css js c++ java
SQL语句
private
string
GetSQL()
{
string
strSQL;
//
strSQL = "select UID,MobileNum,DateTime,PayFlag,grade from SMS_Log where ";
strSQL
=
"
select UID,MobileNum,DateTime,PayFlag=case PayFlag when 0 then '未处理' when 1 then '成功扣费' when 2 then '扣费失败' end,grade=case grade when 0 then '未获奖' when 1 then '一等奖' when 2 then '二等奖' when 3 then '三等奖' end from SMS_Log where
"
;
strSQL
+=
"
1=1
"
;
//
什么都不选的情况
if
(tbUID.Text
!=
""
)
{
strSQL
+=
"
and
"
;
strSQL
+=
"
UID=N'
"
+
tbUID.Text.Trim()
+
"
'
"
;
//
选择用户ID的情况
}
if
(tbBeginTime.Value
!=
""
)
{
strSQL
+=
"
and
"
;
strSQL
+=
"
DateTime>'
"
+
tbBeginTime.Value
+
"
'
"
;
//
选择起始时间的情况,格式2005-4-27 17:33:04
}
if
(tbEndTime.Value
!=
""
)
{
strSQL
+=
"
and
"
;
strSQL
+=
"
DateTime<'
"
+
tbEndTime.Value
+
"
'
"
;
//
选择结束时间的情况
}
if
(cblSelect.SelectedIndex
==
0
)
{
strSQL
+=
"
and
"
;
strSQL
+=
"
PayFlag=1
"
;
//
选择成功扣费的情况,单选
}
if
(cblSelect.SelectedIndex
==
1
)
{
strSQL
+=
"
and
"
;
strSQL
+=
"
PayFlag=2
"
;
//
选择扣费失败的情况,单选
}
if
(cblSelect.SelectedIndex
==
2
)
{
strSQL
+=
"
and
"
;
strSQL
+=
"
PayFlag=0
"
;
//
选择未处理的情况,单选
}
return
strSQL;
}
查看全文
相关阅读:
[LeetCode] Maximum Depth of Binary Tree
C++11中常用的几个简写
[LeetCode] Word Break
[LeetCode] Linked List Cycle II
sizeof
string和整形数据之间的转换
ASCII
[LeetCode] Linked List Cycle
机器学习总结-线性回归
推荐系统初探
原文地址:https://www.cnblogs.com/xiaodi/p/148228.html
最新文章
goldendict
php simple_html_dom
圆龄一年记
研究生计划五
三十了终于明白了些事
智友
读《the facebook effect》
让文字在图片上输出
可持久化线段树和扫描线模板
bzoj 4472: [Jsoi2015]salesman
热门文章
HDU 3549 不要62
裸地并查集
裸地最小生成树
拓扑三小题
POJ 3169 Layout
最长上升子序列
POJ 2135 Farm Tour
HDU 3549 Flow Problem
[LeetCode] Word Break II
[LeetCode] Same Tree
Copyright © 2011-2022 走看看