0
이 방법을 사용하여 Access 2010/13에 밀리 초 타임 스탬프를 구현하려고합니다. MS Access Can Handle Millisecond Time Values--Really - See more at:밀리 초 시간 : 날짜별로 필터 양식
밀리 초 값은 다음과 같이 쿼리됩니다. SELECT DateValueMsec([DateTimeMs]) AS DateOnly FROM
- 텍스트 상자에서 양식을 정렬하기위한 날짜 전용 제어를 제공합니다. DateOnly yeilds 0에서 결과에 프로그래밍 방식으로 필터가 적용되었습니다.
Private Sub BuildFilter()
Dim strFilter As String
Dim ctl As Control
strFilter = ""
'add selected values to string
For Each ctl In Me.FormHeader.Controls
With ctl
If .ControlType = acTextBox Or .ControlType = acComboBox Then
If Nz(.Value) <> "" Then
If InStr(.Name, "Date") <> 0 Then
If Nz(StartDate) <> "" And Nz(EndDate) <> "" And InStr(strFilter, "DateOnly") = 0 Then
strFilter = strFilter & "[DateOnly] BETWEEN #" & Me.StartDate.Value & "# AND #" & Me.EndDate.Value & "# AND "
ElseIf Nz(StartDate) <> "" And InStr(strFilter, "DateOnly") = 0 Then
strFilter = strFilter & "[DateOnly] >= #" & DateValueMsec(Me.StartDate.Value) & "# AND "
' strFilter = strFilter & "[DateOnly] >= #" & Me.StartDate.Value & "# AND "
ElseIf Nz(EndDate) <> "" And InStr(strFilter, "DateOnly") = 0 Then
strFilter = strFilter & "[DateOnly] <= #" & Me.EndDate.Value & "# AND "
End If
ElseIf InStr(.Name, "ID") <> 0 Then
strFilter = strFilter & "[" & .Name & "] = " & .Value & " AND "
Else
strFilter = strFilter & "[" & .Name & "] = '" & .Value & "' AND "
End If
End If
End If
End With
Next ctl
'trim trailing
strFilter = TrimR(strFilter, 5)
Debug.Print strFilter
With Me.subfrmzzAuditTrailDisplay
.Form.Filter = strFilter
.Form.FilterOn = True
End With
End Sub
다른 데이터 유형을 시도했습니다. 쿼리 된 값 및 필터가 ** 날짜 ** 인 경우; 결과는 0 입니다. ** 문자열 ** 결과가 모두 인 경우 필터가 적용될 때 –