Dim cmd As New SQ L Command
Dim dt As DataTable
cmd.Connect i
Dim str As String = e.form.Controls("DropBox1").value
Dim d1 = str.Length
cmd. CommandText = "Sel ect 编制日期,凭证编码,凭证摘要,借方金额,贷方金额,科目名称,尾级名称 from {凭证明细} Where [编制日期] >= '" & e.For m.Controls("StartDate").Value & "' And [编制日期] <= '" & e.Form.Controls("EndDate").Value & "' And [科目编码].SubString(0,d1) = '" & e.Form.Controls("DropBox1").Value & "'"
dt = cmd.ExecuteReader()
想提取科目编码前几位等于选定科目编码的明细。
[科目编码].SubString(0,d1) = '" & e.Form.Co ntrols("DropBox1").Value & "'"
这个需要怎样改呢