filter using 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
 
M

Marshall Barton

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top