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;
}
查看全文
相关阅读:
Shrink / VACUUM Database Sample Code C#
(转)Export .NET MSChart to Excel/PDF Using Report Viewer 2010
VS2010中使用《WeifenLuo.WinFormsUI.Docking.dll》,类型 Universe 无法解析程序集
Binding to a ComboBox using a DataTable and Linq
elementui 点击Switch开关弹出对话框确认后再改变switch开关状态
c# 获取ip和mac
mysql 允许ip访问
jdk下载
vue video 动态地址 不能自动播放
c# 取右侧固定N个字符,不足用0填充
原文地址:https://www.cnblogs.com/xiaodi/p/148228.html
最新文章
如何在控制台程序中读取WORD文档的内容?
一个编程函数集(包含大量C实用函数)
动态真彩工具栏
一个实用的 CToolBar 扩展类 CToolBarEx
关于CRichEditCtrl中文字颜色的控制
C51 怎样将1个子程序段定位在1个固定的地址位置?
C语言编程技巧汇萃(包含大量实用函数)
[转载精品]C++程序员经常问的11个问题
内核printf源代码分析
简单封装的一个彩色进度条
热门文章
如何制作Windows自定义边框的对话框
获得控制台程序的输出
Windows管道技术简述
一步步制作真彩工具条
MD5算法说明及源码
System.Data.SQLite 1.0.83.0 使用试验
Shrink / VACUUM Database Sample Code C#
dockpanelsuite
检测到 ReleaseHandleFailed
(转)Combining ReportViewer and MS Charts
Copyright © 2011-2022 走看看