是的
VB中一般多条件查询,都是写多条SQL语句
IF XM<>"" THEN
Select * from orders where xm ? and orderdate between ? and ?
else
Select * from orders where orderdate between ? and ?
end if
你先试试
我是这样用的,deparam是数据环境,rptparam是报表
deparm中的cmdparam的sql语句是Select * from orders where orderdate between ? and ?
定义两个参数即可
Private Sub cmdprint_Click()
If deparam.rscmdparam.State = adStateOpen Then
deparam.rscmdparam.Close
End If
deparam.cmdparam txtfrom, Txtto
Load rptparam
rptparam.Show
End Sub