iam 使用 ms 访问数据库,我想获取两个日期之间的数据
stdate= starting date
edate=end date
我正在使用下面的代码。
Private Sub Label3_Click()
DataGrid1.Visible = True
Dim stdate As Date
Dim edate As Date
Format = stdate("mm/dd/yyyy")
Format = edate("mm/dd/yyyy")
stdate = Text1.Text
edate = Text2.Text
Adodc1.RecordSource = "SELECT * FROM sales_info WHERE date BETWEEN &stdate& and &edate& "
Adodc1.Refresh
End Sub
我得到的错误是:
syntax error expected array(in format statement)
missing operator in query expression date.
谢谢
请帮助
我是初学者