請問如何把時間寫進去~
目前都會跳錯。
我的日期格式預設為yyyy/mm/dd hh:nn,有計算到分秒
請問是哪裡要修改呢??
[attach]20482[/attach]
Private Sub 查詢_Click()
FltStr = ""
If IsNull(Me![sch查詢]) = False Then FltStr = "sch like [sch查詢] and"
If IsNull(Me![owner查詢]) = False Then FltStr = FltStr & " owner代碼 like '*" & Me![owner查詢] & "*' and"
If IsNull(Me![借出時間起]) = False Then
If IsNull(Me![借出時間迄]) = False Then
FltStr = FltStr & "借出時間 between #" & Me![借出時間起] & "# and #" & Me![借出時間迄] & "# and"
Else
FltStr = FltStr & " 借出時間 between #" & Me![借出時間起] & "# and #" & Date & "# and"
End If
Else
If IsNull(Me![借出時間迄]) = False Then
FltStr = FltStr & " 借出時間 between #" & Date & "# and #" & Me![借出時間迄] & "# and"
End If
End If
If FltStr = "" Then
Me![時間查詢子表單].Form.FilterOn = False
Else
FltStr = Mid(FltStr, 1, Len(FltStr) - 4)
Me![時間查詢子表單].Form.Filter = FltStr
Me![時間查詢子表單].Form.FilterOn = True
End If
End Sub作者: aa7551 時間: 2015-3-23 20:26
在錯誤訊息中已指出,between date and date+time錯誤作者: windclover 時間: 2015-3-24 17:51