filter using date()

  • Thread starter Thread starter adriany
  • Start date Start date
A

adriany

how do i filter using date()?
todaydate, <todaydate

code below

Dim strFilterSQL As String
Select Case Me!optFilterBy
Case 1
strFilterSQL = strSQL & " Where [tdate] = date();"
Case 2
strFilterSQL = strSQL & " Where [tdate] = <date();"
Case 3
strFilterSQL = strSQL & " Where [tdate] = >date();"
Case Else
strFilterSQL = strSQL & ";"
End Select
 
adriany said:
how do i filter using date()?
todaydate, <todaydate

code below

Dim strFilterSQL As String
Select Case Me!optFilterBy
Case 1
strFilterSQL = strSQL & " Where [tdate] = date();"
Case 2
strFilterSQL = strSQL & " Where [tdate] = <date();"
Case 3
strFilterSQL = strSQL & " Where [tdate] = >date();"
Case Else
strFilterSQL = strSQL & ";"
End Select


Less then or equal is written as <=, not as =<

Also make sure that the tdate field is a date.time type
field (and for the = case, that it has no time part).
 
Back
Top