求助!!SQL语句的问题。
cmd1.CommandText = "Select * from setgood where Trim(senddate) >= '" + Format(Text1.Text, "YY-MM-DD") + "'AND Trim(senddate) <= '" + Format(Text2.Text, "YY-MM-DD") + "'AND Custname like '%" + Trim(Text3.Text) + "%' AND Goodname like '%" + Trim(Text4.Text) + "%' OR Custid like '" + Trim(CStr(Text5.Text)) + "'"
出问题,如果没有最后一个条件判断则能正确显示。CUSTID是文本类型的。大伙能说说问题在哪儿吗?求助!