string sql1 = null,sql = null;
string out1 = outdate1.Value.ToShortDateString();
if (out1 != "") sql1 = " 出库日期>='" + out1 + "'";
string out2 = outdate2.Value.ToShortDateString();
if (out2 != "") sql1 += " AND 出库日期<='" + out2 + "'";
string return1 = returndate1.Value.ToShortDateString();
if (return1 != "") sql1 += " AND 归还日期>='" + return1 + "'";
string return2 = returndate2.Value.ToShortDateString();
if (return2 != "") sql1 += " AND 归还日期<='" + return2 + "'";
string type = combobox1.Text.ToString();
if(type !=""){sql1 += " AND 类别 = '" + type + "'";}
string status = combobox2.Text.ToString();
if(status !=""){sql1 += " AND 状态 = '" + status + "'";}
string ways = textbox.Text.ToString();
if(ways != ""){sql1 += " AND 方式 = '" + ways + "'";}
sql = "select * from 表名 where" +sql1;
刚写的,没测试过。
追问以下是我写的,但有很多错误,能改吗?
追答真心看不清,看的好费力
追问点击它可以放大些,会出现另一个页面,再单击可以放大些。不好意思代码太多太乱了,对不起!
追答光看这些图片代码我是没法判断你的代码哪有问题哪能改,只能在电脑上测试了才知道,这样的是没法测试的,我的知识度也没达到那个一看就知道问题程度。