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;
}
查看全文
相关阅读:
终于开通了
<input>表单元素readonly时光标仍然可见
关于字体
SSI架构中get***方法潜在调用
为uploads文件夹瘦身
在JSP里使用CKEditor和CKFinder
centos5.5上搭建svn服务器
多文件上传
属性化ATL,DCOM,SIM,IID
BSTR转换成char*
原文地址:https://www.cnblogs.com/xiaodi/p/148228.html
最新文章
WP构建前台框架之Command
C#/winform 腾讯QQ注册
windows phone 7,sliverlight 下载网页的解析,关于wp7 gb2312编码
PS6.0从入门到精通
C#/WinForm给控件加入hint文字
wIndows phone 7 解析Html数据
招聘: 赴微软软件开发工程师
Extjs4 tab添加右键刷新功能
extjs4 父页面与iframe交互
js replace
热门文章
extjs4 each简单用法
linq to xml 中Descendants和Elements区别
文件路径符号
如何Maven结合IDEA进行Debug
Centos7 源码安装git
从Angularjs升级到Angular(译文)
JoleYe1.5 aspx版发布了
JoleYe动态版1.6发布
JOLEYE发布
用VML画图(一些基本的矢量图)(转)
Copyright © 2011-2022 走看看