- 论坛徽章:
- 0
|
- string strSQL = "";
- strSQL = @"select * from rejectnotify a ,checkupinfo b,barcodeinfo c,partinfo d,procedure e where a.rejectnotifyno=b.rejectnotifyno and a.barcode = c.barcode and c.partno=d.partno and b.poid=e.oid";
- if (sTM != "") strSQL = strSQL + " and a.barcode ='" + sTM + "'";
- if (sBH != "") strSQL = strSQL + " and a.rejectnotifyno ='" + sBH + "'";
- if (sShopNo != "") strSQL = strSQL + " and e.ShopNo ='" + sShopNo + "'";
- if (sProcedure != "") strSQL = strSQL + " and e.ProcedureNo ='" + sProcedure + "'";
- if (sShopNo1 != "") strSQL = strSQL + " and a.DutyShop ='" + sShopNo1 + "'";
- if (sProcedure1 != "") strSQL = strSQL + " and a.DutyProcedure ='" + sProcedure1 + "'";
- if (sChecker != "") strSQL = strSQL + " and a.Checker ='" + sChecker + "'";
- if (sDate1 != "") strSQL = strSQL + " and date(a.CheckUpDate) >=to_date('" + sDate1 + "','%Y-%m-%d')";
- if (sDate2 != "") strSQL = strSQL + " and date(a.CheckUpDate) <=to_date('" + sDate2 + "','%Y-%m-%d')";
- if (sCheckUp != "") strSQL = strSQL + " and a.ProcessMode ='" + sCheckUp + "'";
- if (sState != "") strSQL = strSQL + " and a.State ='" + sState + "'";
- if (sAuditing != "") strSQL = strSQL + " and a.AuditingResult ='" + sAuditing + "'";
- OdbcCommand commandDtl3 = new OdbcCommand(strSQL, conn);
复制代码
if里面的是查询条件
第一句是干什么用的为什么不直接用strSQL = @"select * from rejectnotify
[ 本帖最后由 lrg223 于 2008-10-24 14:09 编辑 ] |
|