
Hi I�ve wrote a program by Delphi 7, I�ve used an Access database and SQL, and also in my tables I have some fields. One of my fields is date_, and the type of the field is DateTime. When I want to select records between 2 dates, I use this query:
Select * from table1 Where date_ between #01/01/2010# and #31/12/2010#
But it shows me the dates that are not in this query! Why?

SQL Query to display record between two dates:
SELECT * FROM emp WHERE JOINING_DATE BETWEEN '2000-01-01' AND '2010-01-01' ;
For the above query, here is the database table.
CREATE TABLE `emp` (
`EMP_NO` int(10) NOT NULL auto_increment,
`EMP_NAME` varchar(100) default NULL,
`DESIGNATION` varchar(100) default NULL,
`JOINING_DATE` date default NULL,
`SALARY` int(100) default NULL,
`DEPT_NO` int(100) default NULL,
PRIMARY KEY (`EMP_NO`)
);

Thanks, because of your attention.
But unfortunately this is not the correct answer to my question.
I've found where my mistake was. I should change my date format to ââ?¬Å?yyyy-mm-ddââ?¬Â? and then I can got the correct query result.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.