同一个表A,写了两个查询,一个是时间段查询。另外一个是名称模糊查询。
时间段查询按钮= select * from A where Time1 between #" + dateTimePicker1.Text + "# and #" + dateTimePicker2.Text + "# "模糊查询按钮=select * from A where EnglishName like '%" + textBoxSearchName.Text + "%' or ChineseName like '%"+ textBoxSearchName.Text+"%' "怎么可以把这两个按钮的查询变成一个按钮的某名称的某时间段查询???
时间段查询按钮= select * from A where Time1 between #" + dateTimePicker1.Text + "# and #" + dateTimePicker2.Text + "# "模糊查询按钮=select * from A where EnglishName like '%" + textBoxSearchName.Text + "%' or ChineseName like '%"+ textBoxSearchName.Text+"%' "怎么可以把这两个按钮的查询变成一个按钮的某名称的某时间段查询???
解决方案 »
- 数据库设计的一个难题
- 如何用Visual C++ 编译这个程序?
- form中保存运行后拖动控件的位置,下次运行时,加载上次运行时控件的位置,请各位大侠帮帮小弟的忙!谢谢了
- ++我想窗体上的Icon不显示,但是任务栏上的icon(即taskbar icon)显示,怎么做?
- 在线等,关于C# TCP/IP Socket 的 输据传输问题!!!!!!!!
- 求关于 序列化 问题。。谢谢
- 怎样用正则表达式去掉标点符号和特殊操作符
- 无法将类型为“System.Data.DataView”的对象强制转换为类型“System.Data.DataTable”
- 求助,程序读取记录时,超时时间已到。在从池中获取连接之前超时时间已过。
- 请大家帮忙
- asp.net连接SQL2000连接问题
- 新手问问题
and (EnglishName like '%" + textBoxSearchName.Text + "%' or ChineseName like '%"+ textBoxSearchName.Text+"%') "
select * from A where Time1 between #" + dateTimePicker1.Text + "# and #" + dateTimePicker2.Text + "# " and
(EnglishName like '%" + textBoxSearchName.Text + "%' or ChineseName like '%"+ textBoxSearchName.Text+"%' ")
select * from A where (Time1 between #" + dateTimePicker1.Text + "# and #" + dateTimePicker2.Text + "# ") and (EnglishName like '%" + textBoxSearchName.Text + "%' or ChineseName like '%"+ textBoxSearchName.Text+"%' ")
textBoxSearchName.Text + "%' or ChineseName like '%"+ textBoxSearchName.Text+"%' " 也可以这样:
select * from (select * from A where EnglishName like '%" + textBoxSearchName.Text + "%' or ChineseName like '%"+ textBoxSearchName.Text+"%' ) B where Time1 between #" + dateTimePicker1.Text + "# and #" + dateTimePicker2.Text + "# "