ADO SELECT WHERE Date Between

I am getting a 'Syntax error in date in query expression' for the following SELECT stmt:

strSQL = "SELECT * FROM Tiko WHERE T_Date BETWEEN #"
strSQL = strSQL & dtStart & "# and #"
strSQL = strSQL & dtEnd & "# ORDER BY T_Date"

dtStart = Date & " 00:00:00 AM"
dtEnd = Date & " 11:59:99 PM"

Please help!!
thanx


thenemesizAsked:
Who is Participating?
 
gozolietConnect With a Mentor Commented:
dtEnd = Date & " 11:59:99 PM"

should be 11:59:59 PM
0
 
Dale FyeConnect With a Mentor Commented:
strSQL = "SELECT * FROM Tiko " _
            & "WHERE T_Date BETWEEN #" & Date() & "# and #" & Date() + .999 & "# " _
            & "ORDER BY T_Date"

0
 
thenemesizAuthor Commented:
so, it was that **11:59:59 PM** all along...thanks gozoliet

...both solutions work!

thanks
0
 
Dale FyeCommented:
If both solutions work, I have no objection to your reopening the question and splitting the points.
0
 
thenemesizAuthor Commented:
modus_in_rebus,

sorry about the points...am new here. How do I reopen the question?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.