mysql> desc persondb;
+--------+-------------+------+-----+---------+-------+
| Field  | Type        | Null | Key | Default | Extra |
+--------+-------------+------+-----+---------+-------+
| name   | varchar(25) | YES  |     | NULL    |       |
| lname  | varchar(25) | YES  |     | NULL    |       |
| mydate | datetime    | YES  |     | NULL    |       |
+--------+-------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> select * from persondb;
+------------+--------+---------------------+
| name       | lname  | mydate              |
+------------+--------+---------------------+
| vishwanath | dalvi  | 2011-08-21 14:50:37 |
| ishwar     | dalvi  | 2011-08-21 14:50:58 |
| ganesh     | kamble | 2011-08-31 14:50:37 |
+------------+--------+---------------------+
3 rows in set (0.00 sec)

mysql> select name,mydate from persondb
    -> where date_sub(now(),INTERVAL 5 DAY)<=mydate;
+------------+---------------------+
| name       | mydate              |
+------------+---------------------+
| vishwanath | 2011-08-21 14:50:37 |
| ishwar     | 2011-08-21 14:50:58 |
| ganesh     | 2011-08-31 14:50:37 |
+------------+---------------------+
3 rows in set (0.00 sec)

I am while using following query to retrieve the records that matched up interval of last five days but it's showing the entry of future date that is ganesh | 2011-08-31 14:50:37

  mysql> select name,mydate from persondb
      -> where date_sub(now(),INTERVAL 5 DAY)<=mydate;

Can anybody let me know the explanation for this ?

SELECT name,mydate FROM persondb
WHERE mydate BETWEEN DATE_SUB(NOW(),INTERVAL 5 DAY) AND NOW();

The main reason your query shows dates later on happens because you see if mydate is later or comparable to five days ago. The date 2011-08-31 14:50:37 fullfils this requirement. You should use BETWEEN to see if it is incorporated in the range from now and five days ago.