要求按照时间段查询计划表内数据,代码怎么写?
Dim Filter As String
With e.Form.Controls("开始日期")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "计划时间 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("结束日期")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "计划时间 <= #" & .Value & "#"
End If
End With
这样写怎么都没用,求大侠帮忙