How to query data whose DATETIME field value is between some time?

J

Jeff Yang

I found the following SQL is wrong(STARTTIME's filed type is DATETIME):
SELECT * FROM TABLE1 WHERE STARTTIME BETWEEN '2003-11-12 11:00:00' AND
'2003-11-12 12:00:00'
can you tell me the right SQL?thanks!
 
A

Allen Browne

Use # as the delimiter:
.... WHERE STARTTIME BETWEEN #2003-11-12 11:00:00# AND #2003-11-12 12:00:00#
 

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